[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Bug report: low-level macros vs. variables in csi
From: |
Felix Winkelmann |
Subject: |
Re: [Chicken-users] Bug report: low-level macros vs. variables in csi |
Date: |
Sat, 15 Mar 2008 18:30:16 +0100 (CET) |
From: John Cowan <address@hidden>
Subject: Re: [Chicken-users] Bug report: low-level macros vs. variables in csi
Date: Sat, 15 Mar 2008 12:47:11 -0400
> Felix Winkelmann scripsit:
>
> > > Proposed course of action: have the interpreter check whether an
> > > identifier is the name of a macro and signal an error rather than using
> > > any existing definition.
> >
> > No, bad idea.
>
> Okay, how about a sentence saying why it's bad? I'd like to put this
> on the wiki somewhere, so other people don't fall into the same trap.
>
Macros are not first class, like procedures. Low-level macros
in general do not actually fit that well into Scheme's semantics.
This situation is slightly less problematic in Lisp-2's (which
still has the same problem). Note that chicken (the compiler)
does complain when you define a global variable withn the same
name as a macro.
Macro-expansion is a preprocessing step, a compiler pass so to
speak - not a runtime thing.
cheers,
felix