Re: Order of macroexpansion




Rainer,

thanks for the quick response.

Outer is expanded. It returns a new form.

Whatever 'outer' returns will then be evaluated
as usual. Rember, the expansion of outer might
or might not have the 'inner' form.

Okay, so that means, if I create a binding in outer during expansion time (as in my example below), this binding will be available at the expansion of inner, right?

(let (store)
(defmacro outer (val &body body) (setf store val) `(progn ,@body))
(defmacro inner (expr) `(,expr ,store)))


So if I specify that inner is only to be used inside some surrounding "outer", inner can be implemented this way, and I am on the safe side?


That is, store is first setf'd by outer, then read by inner.

Is this implementation specific, or can I rely on this?

If I have missed the obvious in the hyperspec, I'd be grateful for the pointer.

Thanks,
Peter
.



Relevant Pages

  • Re: Order of macroexpansion
    ... Kent M Pitman wrote: ... The fact that outer is a macro means a program. ... Lisp cannot know whether inner will still even be in the expansion or, ...
    (comp.lang.lisp)
  • Re: Order of macroexpansion
    ... Whatever 'outer' returns will then be evaluated ... or might not have the 'inner' form. ... Okay, so that means, if I create a binding in outer during expansion ...
    (comp.lang.lisp)
  • Re: inner classes in python as inner classes in Java
    ... It's like inner method.. ... > scope with their outer method... ... different concept from that of rebinding names). ...
    (comp.lang.python)
  • Re: Shed rather promise actually than believe with Evelyns lazy spoon.
    ... Many new smart draper irrigates tags without Cypriene's inner tailor. ... If the bitter pens can pull biweekly, the brave fork may hate more fires. ... Josef never believes until Ann excuses the outer frog finally. ...
    (rec.woodworking)
  • Re: Order of macroexpansion
    ... This syntax isn't a macro call. ... That is, store is first setf'd by outer, then read by inner. ... So when OUTER is being expanded the above expander function allocates ...
    (comp.lang.lisp)