[plt-scheme] 3D boxes and macros

From: Arjun Guha (garjun at cs.brown.edu)
Date: Wed Jul 20 10:27:05 EDT 2005

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.