## Question on top-level (and other) environments

In Lisps, where definitions, expressions, and syntax transformers can be mixed freely in a block of code, the semantics of environments become a bit complicated, I think.

R6RS's expansion process is the best and most clearly described semantics for such blocks that I know.

In effect, a block of code is transformed into a letrec*, with dummy bindings for expressions that are between definitions. Furthermore, the syntax transformation of the right-hand sides is delayed until all definitions in the block have been seen.

This seems sensible, but I wonder if anyone has pointers, information, or rationale for R6RS's and other possible approaches to the semantics of such environments?

Thanks