[plt-scheme] Binding transformers in a macro

From: Noel Welsh (noelwelsh at gmail.com)
Date: Thu Oct 23 20:22:46 EDT 2008

On Thu, Oct 23, 2008 at 5:27 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Thu, 23 Oct 2008 17:13:20 +0100, "Noel Welsh" wrote:
>> Oh Great Gods of Syntax Transformation!
>
> They've never answered me...
>

Well, it worked for me...

>  #`(define-syntax #,import-id (make-rename-transformer #'#,real-import-id))
>
> is probably better.

This works, but I don't fully understand why.  In particular I don't
understand what the #'#, does.  I understand is produces syntax like
(unsyntax <some-syntax-here>) but what is it that then interprets the
unsyntax?  The reader, when it reads the expanded code from the syntax
transformer I guess.  This is necessary to give the real-import-id the
correct context, but I thought syntax carried its context with it (I
assumed this is how hygiene works).  I suppose I need to do some
reading.

> You meant `(macro-foo)' and not `(foo)' at the end of your test, right?

Yes.

Thanks again,
Noel


Posted on the users mailing list.