As an experienced Lisper (and mostly Schemer today) I have used both hygienic as well as non-hygienic (Common Lisp) macros. I'm going to be something of a heretic here, but in nearly every case there is likely something *better* to use than a macro. As an implementor of Scheme i've seen a number of additions that supplement R5RS (or even Common Lisp) that remove just about every need for a macro. A simple builtin function such as LAMBDA-CASE removes the need for just about every Scheme macro in existance. And here is the real kicker... the closer you get to a programmable programming language (what Lisp is known for anyhow), the more odd and almost alien macros become. They almost blend into and become functions themselves, in a way.
If this sounds confusing, imagine a Lisp interpreter (or Lisp Machine) that is always running (and evolving.. just like the good old days). Macros *must* become first-class citizens, or they simply don't make sense at all. And, of course, many people have already proposed such additions! In this manner, they aren't much different from functions which are first-class already. And there have even been "lexical macros" which retain source-level information for debugging purposes. Hmm.. I wonder what else can be tied to lexical scope and is first-class.... functions! | [reply] |
Do you mean case-lambda, or are you refering to something different?
| [reply] |
Eliminating reduntant code has more advantages than just laziness. It improves code quality, especially during maitenance. | [reply] |
Exactly. That's what subroutines and modules are for.
| [reply] |