Subject: Re: python macros
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 17 Jun 2006 05:04:55 -0500
Newsgroups: comp.lang.lisp
Message-ID: <-tadndYbn_NaTg7ZnZ2dneKdnZydnZ2d@speakeasy.net>
funkyj <funkyj@gmail.com> wrote:
+---------------
| TANGENT: C++ templates are the only other preprocessing system that I
| know of that is more powerful than C macros.  Now that I think of it, C
| macros, C++ templates and Lisp macros (lumping scheme and CL together
| here) are the only macro like facilities I know of.  Are there any
| others?  Is there another preprocessing system that is more powerful
| than C++ templates but less powerful than lisp macros?
+---------------

MACRO-10 macros: MACRO-10 is/was the assembler for the DEC PDP-10,
and its macro system included looping [both count-based and looping
over arguments, as well as looping over the characters of an argument!],
branching, concatenation and thus interning of symbols [you could
write GENSYM in it], the assignment/mutation of the compile-time
values of symbols, and arithmetic [including booleans] on those values.
Most importantly, a macro could *define* other macros, whose name(s)
and expansion(s) were computed by the outer macro (at compile-time,
of course). So macros could count the number of times they were called,
and could even accumulate parameter values for use later. [See several
articles I've posted before about using this to implement "byte-strip"
lexical parsing tables for a FOCAL interpreter.]

They were definitely *way* closer to Lisp macros than C macros.
[I can't comment about C++ templates.]


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607