hello
i needed to define a macro that examines the function-definition, and
would appreciate any help.
Here's what that macro rectify-args would do:
Suppose there is a function ++ that (by its definition) takes 1--4
arguments.
Then (rectify-args ++ 1 2 3 4 5)
would result in: (++ 1 2 3 4).;
(rectify-args ++) would result in (++ nil).
I think the above example says all for what i need to do.
yes, i could defadvise the function ++, but i do not want to re-advise
every function. I just want to write a general macro that will help
me rectify the number of args supplied to it.
Thanks.
--Deepak, http://www.glue.umd.edu/~deego
correction: The 'run-time' in the subject-line should be changed to
'compile-time, sorry about that.
Basically, just want a macro (not a function, because some of the
'args' to the macro may be special-forms), that before calling the
target function, makes sure that the number of args passed to the
target-function is acceptable.
> Suppose there is a function ++ that (by its definition) takes 1--4
> arguments.
>
> Then (rectify-args ++ 1 2 3 4 5)
> would result in: (++ 1 2 3 4).;
> (rectify-args ++) would result in (++ nil).
>
> I think the above example says all for what i need to do.