>>>"MS" == Michael Sperber schrieb am 18 Aug 1998
14:52:08 +0200:
[Common Lisp and Elisp]
MS> (defvar bar 23)
MS> (defmacro foo () 'bar)
MS> (let ((bar 42)) (foo)) => 42
(foo) => 23
Holger> Excuse me, but this is evil by design.
MS> Absolutely right, Common Lisp's macro system is evil by design.
MS> I just want macros to obey the same scoping rules as the rest of
MS> the language, and they don't in Common Lisp.
Interesting. Seems I don't understand what you want to say.
(defvar bar 23)
(defun foo ()
bar)
(let ((bar 42)) (foo)) => 42
(foo) => 23
Where is the difference ?
MS> In Scheme,
MS> (define bar 23)
MS> (define-syntax foo
MS> (syntax-rules () ((foo) bar)))
MS> (let ((bar 42)) (foo)) => 23
Holger> Brr, what awful code.
MS> No, it isn't. There are many perfectly valid reasons for a macro
MS> to refer to an outer binding within the same lexical scope.
What are those reasons ? Why not use a different name in let ? You
also have to when you use functions. This would introduce a
non-intuitive difference between the use of macros and those of
functions, if I understand you correctly. And you seem to find some
benefit in it: which is it ? [1]
Holger
Footnotes:
[1] This is a serious question, I'm not trying to suggest that there
isn't a benefit.
--
---
http://www.coling.uni-freiburg.de/~schauer ---
"Keine Shell, kein Prompt, keine Kekse."
-- Jochen Hein in de.comp.os.linux.misc