[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
New macro definers
- To: GJC at MIT-MC
- Subject: New macro definers
- From: JONL at MIT-MC (Jon L White)
- Date: Sat, 17 May 80 16:36:00 GMT
- Cc: (BUG LISP) at MIT-MC, MACSYMA-I at MIT-MC
- Original-date: 17 MAY 1980 1236-EDT
Date: 15 May 1980 11:24-EDT
From: George J. Carrette <GJC at MIT-MC>
Subject: simple DEFMACROs
Date: 15 MAY 1980 0425-EDT
From: JONL at MIT-MC (Jon L White)
try
(DEFSIMPLEMAC FOO (X) `(LIST ,x ,x))
it will automatically "wrap" a LAMBDA around things for the
sake of multiple occurrences of "x", if needed.
A win. For even more winnage, can it arrange to be a SUBR in the
interpreter?
Say, I forgot to mention DEFBOTHMACRO and DEFCOMPLRMACRO. These, along
with DEFSIMPLEMAC are defined in the file MC:NILCOM;MACAID >, and
possibly can be understood from the (minimal) commentary appearing
in their definitions. We've been intending to release a new LISP
(XLISP ==> LISP) but one of the snags is the time to go thru and
figure out all the things that need documenting. Anyway, briefly,
DEFBOTHMACRO makes a SUBR definition, *along with* a macro-definition
which is active only in the compiler; DEFCOMPLRMACRO makes a macro-definition
which is active only in the compiler. Both of these look for the
key word "SIMPLE" after the function/macro name, and if present, use
the DEFSIMPLEMAC form instead of DEFMACRO form. Limitation: DEFSIMPLEMAC
can only accept definitions of one argument, e.g.
(DEFSIMPLEMAC FOO (X) `(AND ,X (FOO ,X)))
but *not*
(DEFMUMBLEMAC BAR (X Y) (LIST X Y))