[racket-users] Re: identifier used out of context

2020-06-06 Thread Sorawee Porncharoenwase
Ah, apparently I need syntax-local-identifier-as-binding. Here’s a revised code that passes the tests. (begin-for-syntax (define ((do-it gs ctx) e) (let loop ([e e]) (define e-expanded (local-expand e (list gs)

[racket-users] Re: identifier used out of context

2020-06-06 Thread Michael Ballantyne
Explicitly expanding `e` would ensure that the expansion work only has to happen once, rather than twice. Even so, the fully-expanded syntax will be expanded again in `syntax-local-bind-syntaxes` and in the expansion. As far as I've seen, the only thing that liberal define contexts control is