From: ludo@gnu.org (Ludovic Courtès)
To: Matthew Flatt <mflatt@cs.utah.edu>
Cc: "dev@racket-lang.org" <dev@racket-lang.org>,
Eli Barzilay <eli@barzilay.org>,
guile-devel@gnu.org
Subject: Re: [racket-dev] Enhancement to the syntax system?
Date: Tue, 10 Jul 2012 17:26:24 +0200 [thread overview]
Message-ID: <87a9z7tz6n.fsf@gnu.org> (raw)
In-Reply-To: <20120710150315.B7B27650059@mail-svr1.cs.utah.edu> (Matthew Flatt's message of "Tue, 10 Jul 2012 09:03:14 -0600")
Hi,
Matthew Flatt <mflatt@cs.utah.edu> 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’.
next prev parent reply other threads:[~2012-07-10 15:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-30 15:22 Enhancement to the syntax system? Stefan Israelsson Tampe
2012-07-02 19:28 ` Ludovic Courtès
2012-07-02 20:43 ` Stefan Israelsson Tampe
2012-07-02 22:41 ` Ludovic Courtès
2012-07-03 14:37 ` Stefan Israelsson Tampe
2012-07-03 21:33 ` Ludovic Courtès
2012-07-03 21:52 ` Stefan Israelsson Tampe
2012-07-04 7:47 ` Marijn
2012-07-04 8:04 ` Stefan Israelsson Tampe
2012-07-09 15:52 ` Ludovic Courtès
2012-07-09 17:40 ` Stefan Israelsson Tampe
2012-07-10 8:24 ` Ludovic Courtès
2012-07-10 13:35 ` Stefan Israelsson Tampe
2012-07-10 14:34 ` Marijn
2012-07-10 14:51 ` [racket-dev] " Eli Barzilay
[not found] ` <20476.16781.257276.194149-a5nvgYPMCZcx/1z6v04GWfZ8FUJU4vz8@public.gmane.org>
2012-07-10 15:03 ` Matthew Flatt
2012-07-10 15:26 ` Ludovic Courtès [this message]
2012-07-10 15:44 ` [racket-dev] " Stefan Israelsson Tampe
2012-07-10 17:47 ` Stefan Israelsson Tampe
2012-07-10 16:48 ` Eli Barzilay
2014-05-03 21:29 ` Marijn Schouten (hkBst)
2012-07-10 15:44 ` Ryan Culpepper
2012-07-10 15:22 ` Ludovic Courtès
2012-07-10 7:36 ` Stefan Israelsson Tampe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a9z7tz6n.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=dev@racket-lang.org \
--cc=eli@barzilay.org \
--cc=guile-devel@gnu.org \
--cc=mflatt@cs.utah.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).