>>>"MS" == Michael Sperber schrieb am 18 Aug 1998
11:08:25 +0200:
MS> Sure, but there's no guarantee that a given macro has hygienic
MS> behavior. Generally, maintaining hygiene this way is pretty
MS> tedious, which is why programmers usually don't go to the
MS> necessary lengths.
I will make a risky statement: a powerful tool should be used
carefully. What you say is certainly true, but - as Paul Graham makes
clear - macros are a way to fool with the way lisp evaluates your
statements. To me, this is like a big red sign yelling: "Careful".
I believe that even in the Elisp programming style tips people are
advised not to use macros if they can be avoided. One example that has
bitten me much to often was the useless use of macros in mailcrypt or
in some VM file, IIRC, which broke whenever I installed a new VM
version. Therewas absolutely no reason to use macros in that
places. Your example below is of the same class:
MS> (defvar bar 23)
MS> and I want to refer to bar (that is, the above binding) in a
MS> macro body:
MS> (defmacro foo () 'bar)
MS> ... but I do:
MS> (let ((bar 42)) (foo)) => 42
Excuse me, but this is evil by design. Brr, what awful code.
Holger
--
---
http://www.coling.uni-freiburg.de/~schauer ---
"Was für'n Agent??? Und wieso benutzt ihr nicht einfach alle die
Standardlösung Outlook Express (früher MS News)? Ist IMHO das beste und
übersichtlichste Programm für PC und dazu noch kostenlos!"
-- Aus "Wie starte ich einen Endlosthread ?", Teil 1239