Re: [CLOS] Ensuring a method exists
- From: Didier Verna <didier@xxxxxxxxxxxxx>
- Date: Wed, 04 Oct 2006 09:01:57 +0200
Rahul Jain <rjain@xxxxxxxx> wrote:
So imagine having A <- B and creating only instances of B. The lack of
method for class A would go unnoticed. But I want the check for the whole
hierarchy (consider for instance that I'm using the AND method combination
type and I'm expecting an implementation for all the classes).
RED FLAG!
You shouldn't be subclassing something if you don't want to get its
functionality as default.
Sorry ? Consider the classic binary method example Point <- ColorPoint with
the point= function. ColorPoint *is* a subclass of Point, and *no*, I don't
want the implementation of point= for Point as the default functionality in
ColorPoint. I want to be sure that there is an implementation of point= for
both classes.
You shouldn't be using subclassing at all here. I suspect that if you use my
library do define a protocol [...]
I'll throw an eye to it; thanks for the pointer.
My library just allows a declaration of what a class conforming to a
protocol should support and a function to test whether it has gotten to that
point after you've loaded all appropriate code.
How much control do you have on the time at which the check is
performed ?
--
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: Rahul Jain
- Re: [CLOS] Ensuring a method exists
- From: Ken Tilton
- Re: [CLOS] Ensuring a method exists
- References:
- Re: [CLOS] Ensuring a method exists
- From: Rahul Jain
- Re: [CLOS] Ensuring a method exists
- Prev by Date: Re: Change function parameter from inside the function
- Next by Date: Re: [CLOS] Ensuring a method exists
- Previous by thread: Re: [CLOS] Ensuring a method exists
- Next by thread: Re: [CLOS] Ensuring a method exists
- Index(es):
Relevant Pages
|