[plt-scheme] 3D boxes and macros
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