From: Steve Haflich

Subject: Re: find method with eql-specialized methods

Date: 1998-7-22 15:48

   From: Stefan Landvogt <nichimen.com at stefan>
   
   I have the following methods
   
   (defmethod foo (arg))
   (defmethod foo ((arg integer)))
   (defmethod foo ((what (eql :bar))))
   
   USER(58): (find-method #'foo '() `( (eql :bla)))
   Error: The generic function #<STANDARD-GENERIC-FUNCTION FOO> does not
   have a method
          with qualifiers NIL specializers ((EQL :BLA))
     [condition type: PROGRAM-ERROR]
   [1] USER(59): 
   
   What is the right thing to do here?

Two problems:

First, you misspelled :BAR as :BLA, but even after correcting that it
still won't work.  Manipulation of EQL specializers is not covered in
the ANS but is specified in the AMOP (see Appendix B in the ACL User
Guide).

The third argument to FIND-METHOD is a list of CLOS:SPECIALIZER
objects.  A CLASS is a CLOS:SPECIALIZER, and so is a
CLOS:EQL-SPECIALIZER.  You obtain a CLOS:EQL-SPECIALIZER for an object
with the function CLOS:INTERN-EQL-SPECIALIZER.

 USER(7): (find-method #'foo () (list (clos:intern-eql-specializer :bar)))
 #<STANDARD-METHOD FOO ((EQL :BAR))>