Re: Finding the applicable methods...

Martin Simmons <[email protected]> Tue, 14 Jul 2026 18:16:10 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
>>>>> On Tue, 14 Jul 2026 17:50:18 +0200, Pascal Costanza (as pc at p-cos dot net) said:
> 
> > On 14 Jul 2026, at 00:56, David McClain (as dbm at refined-audiometrics dot com) <[email protected]> wrote:
> > 
> > So next, when I try to call:
> > 
> > (clos:compute-effective-method #'ord:compare 
> >                                clos::*standard-method-combination*  ;; discovered by probing...
> >                                (compute-applicable-methods #'ord:compare (list (make-thing) (make-thing))))
> > 
> > => 
> > (CALL-METHOD
> >  #<STANDARD-METHOD COMPARE (:AROUND) (T T) 828056D3DB>
> >  ((MAKE-METHOD (CALL-METHOD #<STANDARD-METHOD COMPARE NIL (T T) 8140B0DC03> NIL))))
> > 
> > Whch does indeed show my :AROUND method being called first. But the MOP spec says this function should return an effective method and then a list of effective method options. And CLOSER-MOP does the same thing as the LW version. So both do the “wrong” thing?
> 
> What you see here returned by compute-effective-method is indeed the effective method. There is an additional step, not exposed by the CLOS MOP, which turns the effective method into an effective method function. There is nothing "wrong" here.

Two other points here:

The specification for the second return value of COMPUTE-EFFECTIVE-METHOD in
AMOP is meaningless and doesn't match the CL spec, so I suspect no
implementation returns it.

Instead of CLOS::*STANDARD-METHOD-COMBINATION*, the second argument should be
the value returned by CLOS:GENERIC-FUNCTION-METHOD-COMBINATION for the gf.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html