Open per-gron opened 14 years ago
Hmm.. I've forgotten most of what's required to implement this.
Trying to remember:
syntax-begin
form.Doing this might remove the need of storing phase numbers in some parts of the environment ns data structure, (but not all?) in particular the table thing.
One thing that needs to be done is to modify resolve-imports
so that it only returns one value (not a list of module references). To do this, module-import
needs to be modified so that it doesn't load the modules immediately, and the default *external-reference-access-hook*
needs to be modified to load modules when they are encountered. Furthermore, something needs to be done about macros, I think, because *external-reference-access-hook*
doesn't get invoked for macros.
BUT: I'm not sure this should be done at all. What I've done so far might be sufficient, because it might actually be desirable for modules to be loaded eagerly in the REPL. But how does that work together with phases? I don't know.
For the record: The module metadata fields compiletime-dependencies
and runtime-dependencies
are now calculated from the expanded source and not from the import expressions.
As in http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.151.1568
In practise this would mean to drop
syntax-begin
and/orimport-for-syntax
, and just haveimport
, letting the module system infer in which phases you want to import each module. I think this would make it more intuitive to write macros, which is a good thing.