[R6RS] Eval vs. phases

Michael Sperber sperber at informatik.uni-tuebingen.de
Fri Jul 28 02:28:43 EDT 2006


OK, first really naive question about this.  Why doesn't

<import-spec> --> <import-set>
                | (for <import-set> <import-phase>*)
                | (for-eval <import-set> <import-phase>*)

cut the mustard?

This would mean that the stuff in <import-set> in a `for-eval' spec is
invoked/visited according to the same rules as stuff in a `for' spec,
and the code passed to `eval' is evaluated as if it were sitting in
the body of a module the (the-library-environment) is sitting in,
where the `for-eval' imports apply rather than the `for' imports.

Alternatively, we might do away with mucking with the library syntax
entirely and just have `the-library-environment' evaluate to an
environment corresponding exactly to the library it's sitting in.
This might entail having to create a separate library sometimes.

I suppose that leaves open the question of what happens to the
libraries at levels >= 1 that have been invoked as part of visiting
the one we're in.  I'm assuming these get re-invoked as part of
expanding the eval'ed expression.  (I'm not sure I understand the
semantics of invocation correctly---with re-invoke, I mean that the
(instances of the?) newly invoked libraries don't share state with the
(instances of the?) same libraries invoked at run time.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the R6RS mailing list