[plt-scheme] Expand-syntax and fully expanded programs
2009/7/17 Ryan Culpepper <ryanc at ccs.neu.edu>:
> Jens Axel Søgaard wrote:
> Those lambdas really are #%plain-lambda. Likewise for the #%apps. See the
> yellow warning box (in the right margin) here:
>
> http://docs.plt-scheme.org/reference/syntax-model.html#(part._fully-expanded)
>
> Here's a smaller example. Try just fully expanding a lambda expression:
>
> > (syntax->datum (expand #'(lambda (x) x)))
> (#%expression (lambda (x) x))
>
> If you extract the 'lambda' identifier, you can verify that it's really
> '#%plain-lambda':
Thanks, that was indeed the cause.
I was close though - I used syntax-case* with free-identifier=?
in the old code, but hadn't replaced the old lambda and #%app
with #%plain-lambda and #%plain-app.
Since the wrapping of top-level forms involves no keywords, why not
let the wrapping be
(#%plain-app call-with-values ($%plain-lambda () (if '1 '2 '3))
print-values)
rather than
(#%app call-with-values (lambda () (if '1 '2 '3)) print-values)
?
--
Jens Axel Søgaard