[plt-scheme] 3D boxes and macros

From: Gregory Cooper (greg at cs.brown.edu)
Date: Wed Jul 20 10:32:10 EDT 2005

I was trying to do something similar a while ago, and for some reason 
boxes didn't seem to work correctly as 3d values.  Have you tried using a 
procedure or hash-table to simulate the box?  (That worked for me.)

On Wed, 20 Jul 2005, Arjun Guha wrote:

> That doesn't seem to work either.  It seems like a new box is created--or 
> something.
>
> On Wed, 20 Jul 2005, Jens Axel Søgaard wrote:
>
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> 
>> Arjun Guha wrote:
>>> I have a box defined in the transformer environment, that I insert into 
>>> the syntax.  I'd expect that the set-box! would first mutate the contents 
>>> to 'outer-value, followed by the call to unbox. 
>> 
>> 
>> Is this what you want?
>> 
>> (module box-and-macro mzscheme
>> 
>>  (define-for-syntax the-box (box 'initial))
>> 
>>  (define-syntax (my-macro stx)
>>    (syntax-case stx ()
>>      [(_)
>>       #`(begin
>>           (begin-for-syntax
>>             (set-box! the-box 'value))
>>           (if (eq? (unbox #,the-box) 'value)
>>               'okay
>>               'fail))])))
>> 
>> -- 
>> Jens Axel Søgaard
>

Posted on the users mailing list.