Lisp HUG Maillist Archive

FIND-METHOD with EQL specializers

Hi

this is one of the dark corners of the CLHS.

Suppose I have

	(defmethod foo ((x (eql 42)))
               "Don't panic!")

How do I do a FIND-METHOD for it in LW?

	(find-method #'foo () '((eql 42)))

signals an error.

Cheers


--
Marco Antoniotti					http://bioinformatics.nyu.edu
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.


Re: FIND-METHOD with EQL specializers

On Wed, 5 Jan 2005 19:04:15 -0500, Marco Antoniotti <marcoxa@cs.nyu.edu> wrote:

> this is one of the dark corners of the CLHS.
>
> Suppose I have
>
> 	(defmethod foo ((x (eql 42)))
>                "Don't panic!")
>
> How do I do a FIND-METHOD for it in LW?
>
> 	(find-method #'foo () '((eql 42)))
>
> signals an error.

Not here.

  CL-USER 1 > (lisp-implementation-version)
  "4.4.0"

  CL-USER 2 > (defmethod foo ((x (eql 42))) "Don't panic!")
  #<STANDARD-METHOD FOO NIL ((EQL 42)) 206B5E6C>

  CL-USER 3 > (find-method #'foo () '((eql 42)))
  #<STANDARD-METHOD FOO NIL ((EQL 42)) 206B5E6C>

  CL-USER 4 > (find-method #'foo () '((eql 41)) nil)
  NIL

Are you using an older version?  Maybe it's a bug that has been fixed.
(Although I do remember that I used FIND-METHOD successfully to find
methods with EQL specializers already with 4.3.7.)

Cheers,
Edi.


Updated at: 2020-12-10 08:53 UTC