[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to use call-next-method with an &rest argument
- To: shane%blackcomb@rand.org
- Subject: How to use call-next-method with an &rest argument
- From: smh@franz.com (Steve Haflich)
- Date: Mon, 10 Jul 89 22:50:24 PDT
- Cc: CommonLoops.pa@Xerox.COM, shane@rand.org, dave@rand.org
- In-reply-to: Darrell's message of Mon, 10 Jul 89 17:19:25 PDT <8907110019.AA27276@blackcomb.rand.org>
- Redistributed: CommonLoops.pa
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))