From: Suresh Kalathur

Subject: Help with CLOS Compute-Applicable-Methods

Date: 1997-5-7 12:39

Hi

  I am trying the following piece of code in ACL4.3

(defclass ClassA ()
    ()
  )

(defmethod MethodA ((x ClassA))
  )

(setf obj (make-instance 'ClassA))

(compute-applicable-methods #'MethodA (list obj))


I get as expected
  (#<STANDARD-METHOD METHODA (CLASSA)>)


Now If I do a trace of MethodA

  (trace MethodA)

then
   (compute-applicable-methods #'MethodA (list obj))

results in an error

  Error: No methods applicable for generic function
       #<STANDARD-GENERIC-FUNCTION COMPUTE-APPLICABLE-METHODS> with
       args
       (#<Function (EXCL::ENCAPSULATED METHODA) @ #x104f0f22>
        (#<CLASSA @ #x104ed842>))
       of classes #'CONS
  [condition type: PROGRAM-ERROR]



I see why this happened because the function associated
with #'MethodA is no longer the generic function.


How do I get the behavior as before in this case?

In other words, given a function name, I would like to
get a list of the applicable methods for the given object
and the arguments?

Is there a simpler way than examining all the methods
recursively in the class hierarchy of the given object.

Thanks


-- 
Suresh Kalathur
Cognition Corporation
209 Burlington Rd,
Bedford, MA  01730
(617) 271-9300 x247