[plt-scheme] macrophases

From: Bradd W. Szonye (bradd+plt at szonye.com)
Date: Wed Apr 7 08:55:36 EDT 2004

Bradd wrote:
>> However, the MODULE style also has significant costs. The
>> transformers and the utility functions must reside in different
>> modules. You can put the modules in the same file, but then they
>> don't play nice with PLT's compilation and collection tools ....

Matthew Flatt wrote:
> I believe that `begin-for-syntax' is a better solution to this problem
> than multi-`module' files.
> With `begin-for-syntax', you could write
>  (module m mzscheme
>    (begin-for-syntax
>     (define macro-helper ...)
>     (provide macro-helper))
>    (define-syntax macro ... #| use macro-helper |# ...)
>    (define function ...)
>    (provide macro function))
> and then
>  (require m)
> would introduce `macro-helper' into the transformer environment, as well
> as `macro' and `function' into the run-time environment.

What do you do if you want to use MACRO-HELPER in both environments? Do
you still need to use a separate module in that case?

>> What's special about LET[REC]-SYNTAX that adds more levels to the
>> compile-run hierarchy?

> Nesting. A `let[rec]-syntax' form can appear in the right-hand side of
> a `let[rec]-syntax' binding, which can itself appear in the right-hand
> side of a `let[rec]-syntax' binding, etc.

I understand that they nest; however, I couldn't figure out how that
adds to the compile-run hierarchy.
Bradd W. Szonye

Posted on the users mailing list.