chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [Chicken-users] New to Scheme Macros


From: Jordan Cooper
Subject: Re: Re: [Chicken-users] New to Scheme Macros
Date: Wed, 22 Apr 2009 15:37:00 -0600

Yes, that is interesting. I noticed in the examples on the wiki that
they were calling the rename procedure even for identifiers like
"lambda", which looked different coming from CL macros.

On Wed, Apr 22, 2009 at 3:21 PM, John Cowan <address@hidden> wrote:
>
> Note that the gensym approach used in CL only solves part of the problem
> of macro hygiene.  It prevents the macro code from binding names that
> are used in the macro body with the expectation that the bindings at
> the macro call are in effect.
>
> However, gensyms do not and cannot protect the macro code itself
> from bindings that are in place at the point of call, when the macro
> code expects those names to be bound at the point of macro definition
> (typically globally).  For example, if a non-hygienic macro calls the
> list procedure, and at the point of call the code has bound the name
> "list" to something else, the macro is screwed.
>
> This risk exists in CL, but is mitigated by the presence of separate
> function and variable namespaces, and by the fact that the names exported
> from the "lisp" package cannot be rebound or changed.  It's still possible
> for this problem to bite CL macro writers, and it can't be prevented (as
> opposed to avoided) unless the CL implementation provides an additional
> hygienic macro system that expands *all* code.
>
> --
> At the end of the Metatarsal Age, the dinosaurs     John Cowan
> abruptly vanished. The theory that a single         address@hidden
> catastrophic event may have been responsible        http://www.ccil.org/~cowan
> has been strengthened by the recent discovery of
> a worldwide layer of whipped cream marking the
> Creosote-Tutelary boundary.             --Science Made Stupid
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]