Hi, I want to define a macro that can afford infinite arguments in in its
declaration in the way
(myMacro 1 2 3 4)
(myMacro 1 2 3 4 5)
I mean, in one macro declaration, i want to be able to work with n
arguments.
Can anybody help me?
Thanx
use &rest
(defmacro my-macro (&rest args) do-stuff)
all arguments will then be packed up into a list named args.
On Wed, 23 Feb 2005 02:56:10 +0100, Asuka wrote:
> Hi, I want to define a macro that can afford infinite arguments in in its
> declaration in the way
>
> (myMacro 1 2 3 4)
>
> (myMacro 1 2 3 4 5)
>
> I mean, in one macro declaration, i want to be able to work with n
> arguments.
>
> Can anybody help me?
>
> Thanx
use &rest
(defmacro my-macro (&rest args) do-stuff)
all arguments will then be packed up into a list named args.
OR similarily you can
use (defmacro my-macro (a &rest args)
;;;"a" is first argument while rest of argument
;;;will be packed inside "args". you can use
;;;those elements from "args" using "first:.
<body>)