Re: [CLOS] Ensuring a method exists



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
.



Relevant Pages

  • Re: [CLOS] Ensuring a method exists
    ... hierarchy (consider for instance that I'm using the AND method combination ... functionality as default. ... Consider the classic binary method example Point <- ColorPoint with ...
    (comp.lang.lisp)
  • Re: [CLOS] Ensuring a method exists
    ... only for the class you instanciate, ... functionality as default. ... VALIDATABLE and have method on the VALIDATE g-f as part of the protocol, ...
    (comp.lang.lisp)
  • Re: HardBound and SoftBound
    ... Structure overlays with embedded bit fields? ... Similar functionality ... can be done with bit extract/set accessors, ... By far the cleanest way of doing this is to separate your protocol ...
    (comp.arch)
  • Re: [CLOS] Ensuring a method exists
    ... functionality as default. ... Consider the classic binary method example Point <- ColorPoint with ... And I mean OO in the polymorphic sense, ...
    (comp.lang.lisp)
  • Re: Where does C++ fit in?
    ... But a "flat hierarchy" has little to do with it (in fact, ... hierarchy is ideal for polymorphism). ... PS/2, wheel mice, etc.) but the functionality is similar: ...
    (comp.arch.embedded)