>>>"MS" == Michael Sperber schrieb am 22 Aug 1998
16:12:54 +0200:
MS> (define-syntax foo (syntax-rules () ((foo) bar)))
MS> BAR always refers to the binding of BAR lexically visible in the
MS> macro definition.
Hmm.
(setq bar 23)
(defmacro foo () bar)
(foo) => 23
(let ((bar 42)) (foo)) => 23
(setq bar 57)
(foo) => 23
(let ((bar 42)) (foo)) => 57
So, what do you want ? That foo always refers to 23 regardless whether
I have changed the value of bar in the mean time ?
This seems counter-intuitive to me. It also means that there would be
a difference between the use of macros and functions (i.e. using
functions instead of macros in the above example yields the same
behaviour wrt. to the variable bindings).To me that would mean that
one would save some trouble somewhere but introduce trouble at another
place. But maybe your experience tells you that solving the first
problem (i.e. using the "correct" lexical bindings) is worth the
costs. YMMV as they say.
Holger
--
---
http://www.coling.uni-freiburg.de/~schauer ---
">grep schauer passwd
schauer:x:1075:1075:Holger Schauer,
2790:/home/schauer:/usr/bin/xemacs"
"Das ist nur eine Shell. Bedenklich
waere, wenn Dein LILO /vmunix.el bootet."
-- Kristian und Holger in de.comp.os.linux.misc