[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] mixing hygienic and low-level macros
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] mixing hygienic and low-level macros |
Date: |
Mon, 18 Apr 2005 07:30:50 +0200 |
On 4/16/05, Reed Sheridan <address@hidden> wrote:
> Hi,
>
> Looking through the Chicken sources, I see that most macros are defined
> twice, once with syntax-case and once with low-level macros. Why go through
> the trouble of defining them with syntax-case if they're already defined?
> Is there some pitfall to mixing the use of define-macro and syntax-case that
> I'm missing (it seems to work fine for me), and should I worry about this
> for my own code?
The problem is the hygiene information is lost in low-level macros.
Even though `define-macro' can be expressed with syntax-case,
the transformation of source-code with hygiene-information to
s-expressions strips the decorated source from all that extra information.
So the macros defined with `define-macro' are not hygienic.
Mixing define-macro and syntax-case is possible, but can lead to surprises
with local bindings.
cheers,
felix