Problem with Macro expanding to defmethod
- From: Daniel Trstenjak <Daniel.Trstenjak@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Apr 2006 18:03:01 +0000 (UTC)
Hi all,
I tried to build an abstraction for methods.
Each method should have as first expression
a call to raise-method, which gets the
name of the method and the arguments of the
method call.
(defmacro def-fw-method (name (&rest params) &rest body)
`(defmethod ,name (,@params)
(raise-method ',name ',params)
,@body))
The problem in this version is the invalid usage
of params, because params is the specialized-lambda-list
for defmethod and is not representing the arguments of
the method call.
(defmacro def-fw-method (name (&rest params) &rest body)
`(defmethod ,name (,@params)
(raise-method ',name (list ,@params))
,@body))
This version will work for something like:
(def-fw-method foo (x y z)
...)
But not for something like:
(def-fw-method foo (&rest params)
...)
So I have to do some work on params during macro
expansion time. What is the best/correct way to
extract this information from the specialized-lambda-list ?
Thanks for any advice.
Daniel
.
- Follow-Ups:
- Re: Problem with Macro expanding to defmethod
- From: Kalle Olavi Niemitalo
- Re: Problem with Macro expanding to defmethod
- From: Pascal Costanza
- Re: Problem with Macro expanding to defmethod
- Prev by Date: Re: Can't import
- Next by Date: Re: Foreign Function Interfaces
- Previous by thread: Can't import
- Next by thread: Re: Problem with Macro expanding to defmethod
- Index(es):