- changed status to resolved
define-syntax inside of let(rec)-syntax doesn't confirm R6RS
Issue #11
resolved
This script should print foo
(import (rnrs)) (let-syntax ((a (syntax-rules () ((_) 'foo)))) (define-syntax b (syntax-rules () ((_) (a))))) (display (b))
However, because of the lazy macro expansion, compiler expands (b)
to (a)
then tries to expand (a)
and gets unbound variable error since a
is locally bounded and already discarded at this point.
To resolve this, there are 2 ways;
- expand local macro during first expansion
- lookup
a
from identifier's environment
2 is a bit awkward so 1 is preferable.
Comments (1)
-
reporter - Log in to comment
Modified compile-syntax-case to expand local macro if possible (Fixes
#11)→ <<cset 2dd6f2b4a5e1>>