Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#279 closed defect (fixed)

default-initargs not respected for funcallable-standard-class

Reported by: rschlatte Owned by: rschlatte
Priority: major Milestone:
Component: (A)MOP Version:
Keywords: Cc:
Parent Tickets:

Description

Report by Pascal Costanza:

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.

Change History (2)

comment:1 Changed 8 years ago by rschlatte

Resolution: fixed
Status: newclosed

(In [14344]) Avoid premature initialization of method-class, method-combination in gfs

  • reported by Pascal Costanza

comment:2 Changed 8 years ago by Mark Evenson

(In [14345]) Backport r14344 | rschlatte | 2012-12-30 18:09:06 +0100 (Sun, 30 Dec 2012) | 5 lines

Avoid premature initialization of method-class, method-combination in gfs

  • reported by Pascal Costanza
Note: See TracTickets for help on using tickets.