[armedbear-devel] default-initargs not respected for funcallable-standard-class

Rudolf Schlatte rudi at constantly.at
Sun Dec 9 18:01:47 UTC 2012


On Dec 9, 2012, at 17:07, Pascal Costanza <pc at p-cos.net> wrote:

> Hi,
> 
> What the subject line says. Here is a test case:
> 
> CL-USER(1): (use-package :mop)
> T
> CL-USER(2): (defclass my-method (standard-method) ())
> #<STANDARD-CLASS MY-METHOD {1EE9DE5F}>
> CL-USER(3): (defclass my-generic-function (standard-generic-function) ()
>              (:metaclass funcallable-standard-class)
>              (:default-initargs :method-class (find-class 'my-method)))
> #<FUNCALLABLE-STANDARD-CLASS MY-GENERIC-FUNCTION {6E06D676}>
> CL-USER(4): (defgeneric my-function ()
>              (:generic-function-class my-generic-function))
> #<MY-GENERIC-FUNCTION MY-FUNCTION {2EA1569}>
> CL-USER(5): (generic-function-method-class #'my-function)
> #<STANDARD-CLASS STANDARD-METHOD {4E513D61}>
> 
> 
> The reason is that the defaulting happens in the keyword arguments for ensure-generic-function (in clos.lisp), which thus overrides any default initargs. However, the defaulting should be left to the class.

Thanks, logged at http://trac.common-lisp.net/armedbear/ticket/279

Rudi





More information about the armedbear-devel mailing list