[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: class-direct-methods (CLOS) ?

>In CLOS :
>As it can be done with class slots, I would like to get the :
>  class-direct-methods (as the class-direct-slots)
>  class-methods  (as the class-slots)
>Is it possible ? (I know it is provided in MCS)

If my understanding of CLOS is correct, methods are not directly
associated with classes as was the case in object lisp. Consider
the following methods:

(defmethod FOO ((x CLASS-A) (y CLASS-B))

(defmethod GOO ((x T) (y CLASS-A))

It is hard to say that FOO and GOO are methods for class CLASS-A
or that FOO is a method for CLASS-B.

The function that may solve your needs is COMPUTE-APPLICABLE-METHODS
(page 822 in CLtL2).

Guillaume Cartier
LACIM, Universite du Quebec a Montreal.
Bureau: (514) 987-4290
E-Mail: cartier@math.uqam.ca