[plt-scheme] Eq bindings at different phase levels? (SOLVED)

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Feb 20 10:12:18 EST 2010

On Sat, Feb 20, 2010 at 8:50 AM, Remco Bras <vrsoft at gmail.com> wrote:
> On Sat, Feb 20, 2010 at 3:36 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>> That sounds right. If your registration function is something like
>>
>>  (register 'id proc)
>>
>> then you could make `define-with-transformer' expand to
>>
>>  (begin-for-syntax (register 'id proc))
> That looks about right.
>
>>
>> If your transformer bindings should have the usual lexical scope, you
>> can avoid a hash table and exploit even more of the macro system by
>> having `define-with-transformer' expand to
>>
>>  (define-for-syntax id (make-my-transformer proc))
>>
>> Then, `with-transformer' can use `syntax-local-value' to get an
>> identifier's binding.
>>
>>
> To me, this approach produces a little too much clutter in the
> environment, so I'll go with the above.

If I'm following correctly, then using the second strategy above means
that check syntax will allow you to rename your with-transformers via
its alpha-renaming facilities. (The former doesn't prohibit it, but
means you have to give check syntax hints by putting information into
syntax properties.)

Robby


Posted on the users mailing list.