>>>> "Holger" == Holger Schauer
<schauer(a)coling.uni-freiburg.de> writes:
>>>> "MS" == Michael Sperber schrieb am 26 Aug
1998 09:53:12 +0200:
MS> Another problem with this approach is that it breaks in the
MS> following case:
MS> (setq bar 23)
MS> (defmacro foo () bar)
MS> (defun baz () (foo))
MS> (baz) => 23
Holger> MS (setq bar 42)
MS> (baz) => [still ...] 23
MS> This makes obvious that the macro dereferences the binding too
MS> early. (Namely, at expansion time.)
Holger> Time seems to getting near to issue a bug-report to Bruno Haible[1]
Holger> ... (again the following is from ACL4.3):
Can you explain to me why the above should lead to a different result?
CLISP's output is exactly what I expected it to be:
(setq bar 23)
(defmacro foo () bar) ; this means (foo) expands to the value of BAR
(defun baz () (foo)) ; this therefore expands to (defun baz () 23)
(baz) => 23 ; indeed
(setq baz 42) ; the definition of FOO is unchanged
(foo) => 23 ; presto
I have to admit, though, that this thread is furthering my conviction
that using CL macros right is something fairly difficult :-)
--
Cheers =8-} Chipsy
Friede, Völkerverständigung und überhaupt blabla