guile-devel
[Top][All Lists]
Advanced

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

Re: rackets syntax parse


From: Andy Wingo
Subject: Re: rackets syntax parse
Date: Tue, 07 Feb 2012 22:37:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

On Sat 04 Feb 2012 21:31, Stefan Israelsson Tampe <address@hidden> 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 via email to

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