Problem with Macro expanding to defmethod




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









.