[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Definition time macros



    Date: Mon, 14 Jul 86 20:32:27 MDT
    From: kessler%utah-orion@utah-cs.arpa (Robert Kessler)
    
    I also believe in the CL goal of the exact same semantics between the
    compiler and interpreter.  Its hard enough teaching students Lisp when you
    also have to discuss the grungy details of the differences between compiled
    and interpreted code.  However, one big hole in the CL scheme is that it
    is not specified that all macros must expand at definition time.  That
    is the only way that one can force the same semantics.

    1) Does CL say anything that forbids a system from expanding macros at
    function definition time?

I think not.

    2) Would it be reasonable to add this requirement to the standard?
    ........    

    Bob.
    
On page 143 of CLtL, paragraph 4 indicates that a compiled semantics
for macros is valid also for interpreted code, but it also states
that "an implementation has great latitude in deciding exactly when
to expand macro calls within a program". I'd like to see this
tightened up to indicate that macros expand once, as in a compiler,
and are not expanded over and over each time an expression is
interpreted.  In the interpreter they need not expand at definition
time, but can expand at first evaluation using a "splicing macro"
technique.

...mike beckerle
Gold Hill Computers