[Prev][Next][Index][Thread]
Re: [Q] Dylan to Java/JVM compiler?
On Tue, May 8, 2001, Christopher Stacy <cstacy@spacy.Boston.MA.US> wrote:
>Raffael> macros that are hygenic - unlike Common Lisp macros)
>
>Common Lisp macros do not, in practice, have the hygiene problem
>(that's one of the main uses of GENSYM).
>
>You are probably thinking of a hypothetical problem where
>you have macros like in Common Lisp, but in Scheme.
Uhm, what Dylan means by hygienic macros is that there is no need for
gensym. Of course one can write macros in Lisp that do not inadvertantly
capture variables, but it requires real care and attention with more
complex macros, and is a source of mistakes just waiting to trip you up
during editing. Dylan fixes this by arranging it so that *all* variables
introduced in a macro are unique & new by default, without having to use
gensym--while still allowing variable capture to be explicitly used when
needed.
Considering that 99% or more of all variables introduced in a macro
expansion are *not* intended to capture, it makes a lot more sense to
have this as the default behavior rather than something that has to be
explicitly specified for each variable.
Scott Ribe
scott_ribe@killerbytes.com
http://www.killerbytes.com/
(303) 665-7007 voice
References: