This script should print
(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
(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
afrom identifier's environment
2 is a bit awkward so 1 is preferable.