[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a little problem
- To: email@example.com
- Subject: Re: a little problem
- From: firstname.lastname@example.org (Guillaume Cartier)
- Date: Thu, 9 Jan 92 12:41:32 -0500
- Cc: email@example.com (Macintosh Common Lisp)
>Hello everybody here,
>Happy new year !
>I have a question for you, lisp gurus. Perhaps you'll find it too simple,
>but it's driving me nuts.
>I have a macro that instanciate an object via a side effect:
>(defmacro defTree (theTree)
> `(setq ,theTree (make-instance 'generic-tree-class))
>Now, I want something like defTree* so that I just type:
>(defTree* toto titi tata ...)
>in order to instanciate toto, titi, tata, ...
>The first of you who answers correctly will be declared benefactor of our
>lab, and will receive a postcard (just put your surface mail address)
>Thanks in advance.
>GETA (Groupe d'Etude pour la Traduction Automatique)
>BP 53X, 38041 GRENOBLE CEDEX, FRANCE
With some luck, this will be an easy way to get a nice postcard!
Here is the macro you want:
(defmacro defTree (&rest theTrees)
`(setq ,theTree (make-instance 'generic-tree-class))))
This pattern of macro definition is very common when
you want a macro to have multiple arguments that all have the same
Hope this helps.
LACIM, Universite du Quebec a Montreal.
Bureau: (514) 987-4290