On Mar 30, 2009, at 8:45 AM, Marc Feeley wrote:
On 30-Mar-09, at 6:10 AM, Per Eckerdal wrote:
Does this make sense? Or am I trying to solve a non-problem? Is this overly difficult to understand?
No, it makes perfect sense (to me).
We can argue over the name (syntax-begin, begin-syntax, for-syntax, meta, ...), syntax (what is allowed inside the form?) and scope. But basically such a mechanism is necessary to distinguish the run time environment and the syntactic environment(s).
Just to throw this in there:
The way Scheme48 does it is it has a special form in the module definition to import other modules for the syntax environment. It's my understand this limits you to only import complete modules (not arbitrary code) for the current module's syntax environment. It would look like this:
(module foo (imports bar baz) (for-syntax qux mumble))
The IMPORTS statement does the usual. FOR-SYNTAX imports the `qux' and `mumble' modules for foo's syntactic environment. The syntactic tower comes in to play if qux or mumble imports other packages for their syntactic environment.
This seems less arbitrary and might make it easier to implement.
On the same note, Per, you mentioned not being satisfied with the syntax of your module definitions. It does get complex when you support renaming and other advanced features. Scheme48 has a really syntax good for doing all sorts of cool things when importing modules. You should take a peek at it if you want something different.
- James