Re: [CLOS] Ensuring a method exists
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Wed, 27 Sep 2006 21:04:54 +0200
Jack Unrue wrote:
On Wed, 27 Sep 2006 09:40:18 +0200, Didier Verna <didier@xxxxxxxxxxxxx> wrote:I'd like to ensure that if somebody writes a derived class:
(defclass derived (base) ...)
she also provides a method for this class:
(defmethod foo ((a derived) (b derived)) ...)
Perhaps this constraint should be checked via a wrapper for
calling foo and use that where foo would normally be called
directly? Or use some aspect-oriented approach (maybe AspectL)?
A wrapper would have the disadvantage that the check would be done on each call.
And don't use AspectL for this. ;) Or better, don't use AspectL for anything serious. AspectL was an experiment to better understand AOP. Except for very few cases, all of AspectL's functionality is provided in better and safer ways in ContextL.
And no, ContextL probably also doesn't give you any advantages for this particular case. CLOS is already powerful enough here.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- References:
- [CLOS] Ensuring a method exists
- From: Didier Verna
- Re: [CLOS] Ensuring a method exists
- From: Jack Unrue
- [CLOS] Ensuring a method exists
- Prev by Date: Re: [CLOS] Ensuring a method exists
- Next by Date: Re: toronto, get your ass back in here!
- Previous by thread: Re: [CLOS] Ensuring a method exists
- Next by thread: Re: Lisp, Jazz, Aikido
- Index(es):
Relevant Pages
|
|