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

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

At Fri, 10 Mar 2006 15:22:06 -0500, Sam Tobin-Hochstadt wrote:
> I realize all this, and my use of null as the stop list was just for the
> purposes of the example.  But if letrec-syntaxes+values is not in the
> stop list, why shouldn't it be expanded? 

I still don't understand. Are you equating "expanded" with "removed" in
the case of `letrec-syntaxes+values'?

If the expression is

 (letrec-syntax ([m ...])
   (define (f x) 12)
   (f (m 12)))

and the stop list has just `letrec-values', then the partial expansion
is

 (letrec-syntax+values ([m ...]) ()
   (letrec ([f (lambda (x) 12)])
     (f (m 12))))

So, expansion needs to go inside the `letrec-syntax+values' --- and in
that sense the `letrec-syntax+values' is "expanded" --- but the syntax
bindings are still needed for further expansion.

Matthew



Posted on the users mailing list.