[R6RS] Eval vs. phases
sperber at informatik.uni-tuebingen.de
Thu Jul 13 10:12:07 EDT 2006
dyb at cs.indiana.edu writes:
>> >> Don't we need to distinguish between expand and run phases *within*
>> >> the eval phase?
>> > With Model 2, yes, and it's not clear how to do so. This was what I meant
>> > by "Unfortunately, this makes eval a bit more difficult to handle, since
>> > we'll need some sort of argument or wrapper on the expression passed to
>> > eval to specify the meta levels at which the libraries used by the
>> > evaluated code are invoked".
>> I was thinking less in terms of the semantics of execution, but in
>> terms of what's visible. Doesn't that problem remain even in Model 1?
> No. I don't see where your confusion lies, but let me try to elaborate
> further and see if that helps.
> For each library, there's expand-time information (at least a list of the
> exported identifiers and the values of the transformers) needed to expand
> the code that depends upon it, and there's run-time information (at least
> the set of exported variable values) needed at run time by code that
> depends upon it. Let's say that a library is "visited" to make the
> expand-time information available and "loaded" to make the run-time
> information available. Loading a library causes its top-level forms to be
> evaluated as well as the values of its exported variables established.
I didn't make my question very clear. My question is not about the
semantics of visiting or loading---it's about what identifiers are
visible. The way I understand the library proposal, the import phase
controls what identifiers are visible in "regular" code and what
identifiers are visible in macro transformers. I was expecting that
this distinction is preserved even in Model 1.
Consider a library module `helper' exporting `foo'. Now I have a
(import (for helper run))
... foo ...))
^^^^ not visible in the absence of other imports for `foo'
Now, if I say
(import (for helper eval))
Does the binding for `foo' show up in "regular" code *and* in macro
expanders? If not in macro expanders, how do I make it show up?
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
More information about the R6RS