[CLOS] Ensuring a method exists
- From: Didier Verna <didier@xxxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 09:40:18 +0200
Hi !
Suppose I have:
(defgeneric foo (a b) ...)
(defclass base () ...)
(defmethod foo ((a base) (b base)) ...)
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)) ...)
I'd be happy with a dynamic solution. Perhaps, the method combination would
check that the first applicable method matches exactly the class of the
arguments. But I know nothing about the MOP yet ...
Thanks !
--
Check out my new jazz CD on http://www.didierverna.com/ !
Didier Verna EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 44 08 01 85
94276 Le Kremlin-Bicêtre, France Fax.+33 (1) 53 14 59 22
.
- Follow-Ups:
- Re: [CLOS] Ensuring a method exists
- From: Jack Unrue
- Re: [CLOS] Ensuring a method exists
- From: Wade Humeniuk
- Re: [CLOS] Ensuring a method exists
- From: Christophe Rhodes
- Re: [CLOS] Ensuring a method exists
- From: Lars Rune Nøstdal
- Re: [CLOS] Ensuring a method exists
- Prev by Date: Re: slime, debian(testing, 2.6.8), sbcl(0.9.16)
- Next by Date: Re: Numerical Recipes site has Common Lisp code for scientific computing.
- Previous by thread: High accuracy timer?
- Next by thread: Re: [CLOS] Ensuring a method exists
- Index(es):
Relevant Pages
|
|