Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#284 closed enhancement (fixed)

checks in ensure-generic-function-using-class should occur later

Reported by: rschlatte Owned by: rschlatte
Priority: blocker Milestone: 1.1.1
Component: (A)MOP Version: 1.2.0-dev
Keywords: closer-mop quicklisp AspectL filtered-functions Cc:
Parent Tickets:

Description

In ensure-generic-function-using-class, abcl is making a few sanity checks and issuing errors, and it is correct to do so according to the HyperSpec?. However, since they are done already at such an early stage, some useful MOP idioms are not easily expressible, or at least need to be expressed differently, and I think it would be better to perform the checks at a later stage, for example inside shared-initialize.

The concrete case that I encounter is the :lambda-list initialization parameter. In AspectL and filtered-functions, I need to be able to modify the lambda list internally, by adding one or two extra required parameters. I do this, extremely roughly, as follows:

(defmethod initialize-instance :around ((gf my-generic-function) &rest initargs &key lambda-list)
 (apply #'call-next-method gf
        :lambda-list (list* extra-parameters… lambda-list)
        initargs))

All methods that are added to such generic functions also get the extra parameters padded in during method metaobject initialization. However, due to this, the lambda list that ensure-generic-function-using-class sees is, by definition, not congruent with potentially existing methods, and thus complains about this fact with an error. If the check would only occur later (for example in shared-initialize on standard-generic-function), then the modifications would correctly pass through. At least, that is the case in all the other MOP implementations in which AspectL and filtered-functions work.

Change History (6)

comment:1 Changed 8 years ago by rschlatte

(Reported by Pascal Costanza)

comment:2 Changed 8 years ago by Mark Evenson

Milestone: 1.2.0
Priority: minorblocker
Version: 1.2.0-dev

comment:3 Changed 8 years ago by Mark Evenson

Keywords: closer-mop quicklisp AspectL filtered-functions added

comment:4 Changed 8 years ago by rschlatte

Resolution: fixed
Status: newclosed

(In [14347]) defer checking for lambda list congruence.

comment:5 Changed 8 years ago by Mark Evenson

(In [14348]) Backport r14347 | rschlatte | 2013-01-05 19:39:28 +0100 (Sat, 05 Jan 2013) | 3 lines

defer checking for lambda list congruence.

comment:6 Changed 8 years ago by Mark Evenson

Milestone: 1.2.01.1.1
Note: See TracTickets for help on using tickets.