[plt-scheme] why does local-expand leave letrec-syntaxes+values

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Mar 10 13:49:22 EST 2006

Local-expand, when expanding a letrec-syntaxes+values, expands the body
using the declared syntax expanders, but leaves the letrec-syntaxes
+values in place, whereas expand transforms it into a letrec-values.
Why is this?

For example:

> (define-syntax (go stx)
    (syntax-case stx ()
      [(_ s) (begin (display (syntax-object->datum (local-expand #'s
'expression null)))
                    #'(void))]))

> (go (letrec-syntaxes+values () () 4))
(letrec-syntaxes+values () () (#%datum . 4))

> (syntax-object->datum (expand #'(letrec-syntaxes+values () () 4)))
(begin (#%datum . 4))

Thanks,

sam th



Posted on the users mailing list.