[armedbear-ticket] [armedbear] #284: checks in ensure-generic-function-using-class should occur later

armedbear armedbear-devel at common-lisp.net
Tue Jan 1 20:42:20 UTC 2013


#284: checks in ensure-generic-function-using-class should occur later
-------------------------+--------------------------------------------------
 Reporter:  rschlatte    |       Owner:  rschlatte
     Type:  enhancement  |      Status:  new      
 Priority:  minor        |   Milestone:           
Component:  (A)MOP       |     Version:           
 Keywords:               |  
-------------------------+--------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/284>
armedbear <http://common-lisp.net/project/armedbear>
armedbear


More information about the armedbear-ticket mailing list