[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use call-next-method with an &rest argument



   Date: Mon, 10 Jul 89 17:19:25 PDT
   From: Darrell <shane%blackcomb@rand.org>

   How can call-next-method be used within a method that has an &rest 
   argument.  Suppose that I want to add an initialization argument 
   :foo to the list of initargs passed to initialize-instance.

   (defmethod initialize-instance :around ((self my-class) &rest initargs)
     (call-next-method self (append (list :foo 10) initargs)))

   The method above is not correct, the next method will always be passed 
   exactly two arguments.

How about:

   (defmethod initialize-instance :around ((self my-class) &rest initargs)
     (apply #'call-next-method self :foo 10 initargs))