Order of macroexpansion
- From: Peter Hildebrandt <peter.hildebrandt@xxxxxxxxx>
- Date: Thu, 31 Jan 2008 14:15:36 +0100
Say, I have the macros outer and inner, and I write the following:
(outer 10 (inner +1))
Is it specified, in which order outer and inner are expanded? I see that in sbcl outer is expanded before inner, and I can do the following:
(let (store)
(defmacro outer (val &body body) (setf store val) `(progn ,@body))
(defmacro inner (expr) `(,expr ,store)))
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
.
- Follow-Ups:
- Re: Order of macroexpansion
- From: Kent M Pitman
- Re: Order of macroexpansion
- From: Pascal Costanza
- Re: Order of macroexpansion
- From: Rainer Joswig
- Re: Order of macroexpansion
- Prev by Date: Re: Paul Graham's Arc is released today... what is the long term impact?
- Next by Date: Re: Security
- Previous by thread: Arc already more popular than Python...
- Next by thread: Re: Order of macroexpansion
- Index(es):
Relevant Pages
|