[Openmcl-devel] An error in the MOP implementation?

Jens Bjerrehuus jens at bjerrehuus.dk
Mon Mar 6 12:50:29 PST 2006


   I'm using the introspection facilities in the MOP to implement a  
test framework and I'm running into a problem with the return value  
from METHOD-FUNCTION.  In OpenMCL METHOD-FUNCTION returns a  
FUNCALL'able method function, which does not accept a list of next- 
methods as a second argument.  According to this thread (http:// 
www.codecomments.com/message394530.html), which references the MOP  
documentation for MAKE-METHOD-LAMBDA, the returned method function  
should accept two arguments: the list of arguments to the generic  
function and the list of next-methods.  This is also how it works in  
e.g. SBCL, which I'm using as a second implementation to test for  
portability.

   The example given in the above mentioned thread results in an  
error in OpenMCL:

(defgeneric foo (x)
   (:method ((x integer)) (isqrt x))
   (:method ((x real)) (sqrt (float x))))
(setq my-method (find-method #'foo nil (list (find-class 'real))))
(setq my-arglist (list 43))
(funcall (openmcl-mop:method-function my-method) my-arglist '())

Too many arguments in call to #<METHOD-FUNCTION FOO (REAL)>: 2  
provided, at most 1 accepted.
    [Condition of type CCL::TOO-MANY-ARGUMENTS]

   I'm not subscribed to the bug mailing list, so I thought I'd post  
it here.  Maybe also to get an idea, whether others agree that it is  
indeed an error in OpenMCL's MOP implementation.

-Jens



More information about the Openmcl-devel mailing list