Subject: Re: Loops in macro definition
From: (Rob Warnock)
Date: 22 May 2001 09:03:08 GMT
Newsgroups: comp.lang.scheme
Message-ID: <9eda0c$aamql$>
Iain McClatchie  <> wrote:
| So, getting back to the original point, I can get a loop in my
| macro by having it output a keyword on which it will match again.
| This would appear to have a great deal of overhead, since all
| the stuff has to be rematched.  But there is an analogy here to
| tail-call elimination in runtime recursion.  Do any of the
| Scheme implementations do some sort of tail-call macro rematching
| elimination?

Just write your macros so they "don't do that"!  That is, instead
of generating the same keyword, just loop and generate the whole
thing at once. (Though I admit that's certainly easier to do if
you're using "defmacro" than "syntax-rules"...)


Rob Warnock, 31-2-510
SGI Network Engineering		<URL:>
1600 Amphitheatre Pkwy.		Phone: 650-933-1673
Mountain View, CA  94043	PP-ASEL-IA