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

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Mar 10 15:02:34 EST 2006

At Fri, 10 Mar 2006 13:49:22 -0500, Sam Tobin-Hochstadt wrote:
> 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?

Because `local-expand' is normally used with "stop" bindings that leave
sub-expressions unexpanded, whereas `expand' fully expands all
expressions.

It's possible that `local-expand' could handle specially the case of an
empty stop list, but I'm not sure that would always work right, since
the result of `local-expand' is typically fed back to the macro
expander (as a sub-expression of a macro result).

Matthew



Posted on the users mailing list.