Re: Problem with Macro expanding to defmethod
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Thu, 27 Apr 2006 23:17:39 +0200
Kalle Olavi Niemitalo wrote:
All this mess could perhaps be avoided with the MOP. I recall it
generates a "method function" for each method, and the method
function receives the whole argument list as well as a list of
next methods. So if you could hook up into how that function is
generated, you could snatch the argument list before it is
chopped up into separate parameters. I don't know how this might
best be accomplished in practice.
You could implement a method class, roughly like this:
(defclass raising-method (standard-method)
())
(defmethod initialize-instance :around
((method raising-method) &rest initargs &key function)
(declare (dynamic-extent initargs))
(apply #'call-next-method method
:function (lambda (args &rest other-args)
(declare (dynamic-extent other-args))
(raise-method
(method-generic-function method)
args)
(apply function args other-args))
initargs))
Many MOP implementations don't adhere to the MOP spec here, though.
Pascal
--
3rd European Lisp Workshop
July 3-4 - Nantes, France - co-located with ECOOP 2006
http://lisp-ecoop06.bknr.net/
.
- References:
- Problem with Macro expanding to defmethod
- From: Daniel Trstenjak
- Re: Problem with Macro expanding to defmethod
- From: Kalle Olavi Niemitalo
- Problem with Macro expanding to defmethod
- Prev by Date: Re: Allegro CL on OS X-Intel
- Next by Date: Re: Vaguely Lisp related talk tomorrow (4/26) at SDForum SAM SIG
- Previous by thread: Re: Problem with Macro expanding to defmethod
- Next by thread: Allegro CL on OS X-Intel
- Index(es):