[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Code Generated by Macros
- To: greek@DEC-HUDSON.ARPA
- Subject: Code Generated by Macros
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Wed, 24 Apr 85 21:29 EST
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: The message of 24 Apr 85 12:58-EST from greek@DEC-HUDSON
Date: Wed, 24 Apr 85 12:58:16 EST
We found that the following "macros" generated loops that hid a
surrounding NIL block:
DO-SYMBOLS et al
lots of compiler transformations (e.g., that turned a map
into a loop)
DO-SYMBOLS is clearly documented to create a block named NIL.
You're right that the others are errors. Our implementation handles
these correctly, but perhaps you were talking about macro definitions in
some other implementation, such as Spice Lisp. It's quite easy to do
Also, of course, plenty of macros written by users can inadvertently
cause the problem.
The simplest way around is to only generate TAGBODYs. Even PROG
establishes a NIL block.
A good rule of thumb is never to use PROG under any circumstances for
The real problem is DO, which you would often like to use, but have
to be careful about whether you intended to create a block or not.
A good rule of thumb is to write macros whose name does not start
with "DO" in terms of BLOCK, LET, and TAGBODY only -- then everything