[plt-scheme] Using generated names for top-level bindings
At Wed, 15 Sep 2004 21:36:57 -0400 (EDT), Andre van Tonder wrote:
> Is the following error legitimate?
>
> (define-syntax test
> (lambda (stx)
> (syntax-case stx ()
> ((_) (with-syntax ((name (car (generate-temporaries
> (list (syntax _))))))
> (syntax (begin
> (define name 1)
> (display name))))))))
>
> (test)
> ==> compile: bad syntax; reference to top-level identifiers is not
> allowed, because no #%top syntax transformer is bound in: test13
One solution is to change
(display name)
to
(display (#%top . name))
I'm not happy with this solution, and I'm working on a better one.
Matthew