Re: [CLOS] Ensuring a method exists



Didier Verna wrote:
Lars Rune Nøstdal <larsnostdal@xxxxxxxxx> wrote:

Hm, ok - maybe something like this:

(dolist (class (sb-mop:class-direct-subclasses (find-class class)))

Yup, that's the kind of thing I was looking for, thanks. Actually,
I'll use class-direct-SUPERclasses to go up the hierarchy, and also filter out
(find-class 'standard-object) from the check list. But that's the idea.

If you really need the list of all direct and indirect superclasses, you can simply call class-precedence-list. (This may only work when the class is already finalized, that is, roughly when an instance of that class already exists.)


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/
.



Relevant Pages

  • Re: [CLOS] Ensuring a method exists
    ... I'll use class-direct-SUPERclasses to go up the hierarchy, and also filter out ... (find-class 'standard-object) ... When moving upwards while only looking upwards you'll miss the branches ...
    (comp.lang.lisp)
  • Re: [CLOS] Ensuring a method exists
    ... I'll use class-direct-SUPERclasses to go up the hierarchy, and also filter out ... (find-class 'standard-object) ...
    (comp.lang.lisp)