guile-devel
[Top][All Lists]
Advanced

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

Re: [racket-dev] Enhancement to the syntax system?


From: Ludovic Courtès
Subject: Re: [racket-dev] Enhancement to the syntax system?
Date: Tue, 10 Jul 2012 17:26:24 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux)

Hi,

Matthew Flatt <address@hidden> skribis:

> It's natural --- but not correct --- to think that #` is responsible
> for hygiene, in which case `(f #'x)' should keep the given `x' separate
> from the `let'-bound `x' in the result.

[...]

> If you change the example to
>
>  #lang racket
>  (begin-for-syntax 
>   (define-syntax-rule (f body)
>     #`(let ([x 1]) body)))
>  (define-syntax (m stx)
>    (with-syntax ([zz (f x)]) #`(let ([x 2]) zz)))
>  (m)
>
> so that `f' is used as a macro instead of a function, then you get 2,
> since the macro-expansion of `(f x)' keeps the `x's separate.

Interesting.  Thanks for the clarification and examples.

Ludo’.



reply via email to

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