[Top][All Lists]
[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’.
- Re: Enhancement to the syntax system?, (continued)
- Re: Enhancement to the syntax system?, Ludovic Courtès, 2012/07/09
- Re: Enhancement to the syntax system?, Stefan Israelsson Tampe, 2012/07/09
- Re: Enhancement to the syntax system?, Ludovic Courtès, 2012/07/10
- Re: Enhancement to the syntax system?, Stefan Israelsson Tampe, 2012/07/10
- Re: Enhancement to the syntax system?, Marijn, 2012/07/10
- Re: [racket-dev] Enhancement to the syntax system?, Eli Barzilay, 2012/07/10
- Re: [racket-dev] Enhancement to the syntax system?, Matthew Flatt, 2012/07/10
- Re: [racket-dev] Enhancement to the syntax system?,
Ludovic Courtès <=
- Re: [racket-dev] Enhancement to the syntax system?, Stefan Israelsson Tampe, 2012/07/10
- Re: [racket-dev] Enhancement to the syntax system?, Stefan Israelsson Tampe, 2012/07/10
- Re: [racket-dev] Enhancement to the syntax system?, Eli Barzilay, 2012/07/10
- Re: [racket-dev] Enhancement to the syntax system?, Ryan Culpepper, 2012/07/10
- Re: Enhancement to the syntax system?, Ludovic Courtès, 2012/07/10
- Re: Enhancement to the syntax system?, Stefan Israelsson Tampe, 2012/07/10