[plt-scheme] Macro-expansion-time structs
2008/10/11 Eli Barzilay <eli at barzilay.org>:
> The answer to both of these questions is that you should use
>
> (require (for-syntax scheme/base))
Thank you for the quick reply!
This solves one of the problems. However, something like this still
doesn't work:
---
#lang scheme/base
(require (for-syntax scheme/base))
(provide test)
(define-struct my-box (val))
(define-syntax test
(lambda (stx)
#`#,(my-box-val (make-my-box 2))))
---
henk at korhal ~ $ mzscheme -i -t test.ss
Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
test.ss:11:9: compile: unbound variable in module (in the transformer
environment, which does not include the run-time definition) in:
my-box-val
---
define-struct really seems to be a runtime thing. . .
Henk