unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: rackets syntax parse
Date: Tue, 07 Feb 2012 22:37:03 +0100	[thread overview]
Message-ID: <8739am2um8.fsf@pobox.com> (raw)
In-Reply-To: <CAGua6m2+hDH86QUaRZxFYNVb0ZtA=XD3Svzss=+HYYWPwDDefQ@mail.gmail.com> (Stefan Israelsson Tampe's message of "Sat, 4 Feb 2012 21:31:51 +0100")

On Sat 04 Feb 2012 21:31, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> #'(begin
>      (define f fkn-definition)
>      (define-syntax name
>          (make-syntax-case-transformer
>                (make-stxclass
>                      ...
>                      (datum->syntax #'name 'f)
>                      ...))))
>
> This code expans ok in the toplevel. But if expanded elsewhere in definition
> context f is not reached from the data associated with the macro.

So, a few things.

One is that if #'name came from the macro invocation but f did not, then
indeed f is not visible from #'name.

That this works at the top level is a byproduct of a bug in stable-2.0
that is "fixed" in master.  (There are two bugs: one about module
scoping of introduced toplevel identifiers, and another about the
symbolic names of introduced toplevel identifiers.  See
https://savannah.gnu.org/bugs/?31472.)

> So how can I make this to work in both contexts?

Just use #'f instead of (datum->syntax #'name 'f).

Cheers,

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2012-02-07 21:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22 22:38 rackets syntax parse Stefan Israelsson Tampe
2012-01-25 20:37 ` Stefan Israelsson Tampe
2012-01-26 11:36   ` Andy Wingo
2012-01-27 21:13     ` Stefan Israelsson Tampe
2012-02-04 20:31       ` Stefan Israelsson Tampe
2012-02-07 21:37         ` Andy Wingo [this message]
2012-02-07 21:58           ` Stefan Israelsson Tampe
2012-02-07 22:55             ` Andy Wingo
2012-02-08 20:16               ` Stefan Israelsson Tampe
2012-02-08 21:50                 ` 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=8739am2um8.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=stefan.itampe@gmail.com \
    /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).