[racket-dev] problem with local-expand and module-begin

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Jun 13 02:44:42 EDT 2012

At Wed, 13 Jun 2012 14:31:12 +0800, Sam Tobin-Hochstadt wrote:
> I'm trying to use the new behavior of `local-expand` to handle
> submodules in Typed Racket.  However, I can't get the stop list to
> work the way I thought it would.  In particular, this expression:
>     (local-expand #'(#%plain-module-begin forms ...) 'module-begin
> (list #'module*))
> doesn't stop on occurrences of `module*` inside `forms ...`, or
> anything else for that matter.  Even if I add other identifiers to the
> stop list, nothing happens.  You can see this behavior in the attached
> test program.  If I use `#false` for the stop list, I do get the
> expected behavior, but not for any actual list.
> Am I doing something foolish, or is there a problem here?

There's a problem. (I tested that `module*' in a stop list doesn't imply
other things, but I didn't check that expansion actually stopped at

The problem is that the `#%plain-module-begin' transformer juggles
`module*' forms specifically. The transformer needs to effectively
check whether `module*' is in the stop list.

I should be able to push a repair later today.

Posted on the dev mailing list.