Re: Defmacro Signature





Michael Bohn wrote:
I found this macro-lambda-list in a lisp source file written by Edi Weitz.

(defmacro insert-char-class-tester ((char-class chr-expr) &body body)
^^^^^^^^^^^^^^^^^^^^^
I can't see how this definition conforms to the hyperspec:

http://www.lispworks.com/documentation/HyperSpec/Body/03_dd.htm
reqvars::= var*

Not sure about how to read grammars, but he is using "destructuring by lambda lists":

http://www.lispworks.com/documentation/HyperSpec/Body/03_dda.htm



Is this form often used in macro-definitions??

Absolutely, and it is one of coolest things about macro writing that one can easily offer the kind of structure you find in defclass in your own macros. This is part of how "code as data" pays off, and one of the things that would make macro-writing in other languages quite hard.

kt

--
Well, I've wrestled with reality for 35 years, Doctor, and
I'm happy to state I finally won out over it.
-- Elwood P. Dowd

In this world, you must be oh so smart or oh so pleasant.
-- Elwood's Mom
.