chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] macro systems and chicken (long)


From: felix winkelmann
Subject: Re: [Chicken-users] macro systems and chicken (long)
Date: Wed, 9 Apr 2008 12:31:51 +0200

On Tue, Apr 8, 2008 at 12:45 PM, Alaric Snell-Pym
<address@hidden> wrote:
>
>  riaxpander manages this:
>
>
> > (use riaxpander)
> >
> > (define-macro (my-assert test error)
> >        `(if (not ,test) (error ,error)))
> >
> >
> > (define-syntax foo
> >        (syntax-rules ()
> >                ((_ x) (let ((tmp x)) (my-assert x "failed")))))
> >
> > (macroexpand '(let ((x 1)) (foo x)))
> >
> >

In this case the hygiene is actually circumvented: riaxpander
runs before the normal macro-expansion (the expansion of
low-level macros happens afterwards which makes this
work). Referential transparency requires that bindings that
are introduced by a hygienic macro may not be accessible by
name alone by other macros (context is required as well).
(Now, I believe this is the correct wording, but I may be wrong)


cheers,
felix




reply via email to

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