On Thu, Apr 2, 2009 at 8:33 AM, Marc Feeley feeley@iro.umontreal.ca wrote:
Note that A requires B both for run time and expansion time. In a model with a syntactic tower there are two instances of B, that is B0 (run time) and B1 (expansion time). What is the relationship between v from B0 and v from B1 (let's call them B0.v and B1.v)? I feel that there should be no interaction between levels, except the macro expander acts as a bridge between levels. So B0.v and B1.v should be distinct variables.
Do we all agree on this?
Yep, I agree.
There will be a substantial run time cost to implement this because each instance of a module is basically a closure, and thus there will be an additional indirection to access global variables.
I'm assuming you mean "run-time" of the compiler. You could, of course, compile all this out. But this might make the compilation stage take longer.
If you wanted to keep all the symbols in a flat list for efficiency, what about mangling names of identifiers in syntactic environments? It seems that you would know which level of the syntactic tower you are at when you evaluate a piece of code. You could suffix the level to an identifier, so B1.v would become B1.v-1.
(I hope this message doesn't go through multiple times, having troubles with my mail client)
- James