> > In my experience, defmacro is capable of defining any syntactic > > transform that the more modern Scheme macros can. > > I should think so: the whole point of high-level macro schemes is that > they are not Turing-complete over the domain of the source text, and > therefore they can be given a (partly) declarative interpretation. > Syntax-rules is of course entirely declarative.
Actually, the point is that they permit one to deal sensibly with lexical scoping at the source level. This not only simplifies the coding of many macros but also allows the definition of others that cannot be written with defmacro. For example, one can use syntax-rules and syntax-case to write macros that perform arbitrary code motion (e.g., define-integrable) without breaking lexical scope. In fact, syntax-case is strictly more expressive than the old-style Lisp macros represented by defmacro. The lisp-transformer on page 54 of the library document shows how syntax-case can be used (trivially) to write old-style Lisp macros. Defmacro itself is easily defined using lisp-transformer. In other words, hygienic macros are an enabling technology, not a limiting one, despite a common misconception to the contrary. They help prevent unintended captures and allow the definition of certain macros that cannot otherwise be defined, but you don't lose anything by using them, not even the ability to write macros that completely destroy hygiene. Kent _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
