[plt-scheme] Expand-syntax and fully expanded programs

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Thu Jul 16 20:41:42 EDT 2009

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))

rather than

    (#%app call-with-values (lambda () (if '1 '2 '3)) print-values)


Jens Axel Søgaard

Posted on the users mailing list.