Mark H Weaver <m...@netris.org> writes: > Here's an improved version of the preliminary evaluator-only > implementation of `the-environment' and `local-eval'. I renamed the > primitives to the Guile 1.8 names, fixed the expansion within > `local-eval' to use `expand' instead of `expand-top-sequence', made the > module handling more robust, and various other minor improvements. > > I plan to fully support these primitives in the compiler as well, in a > future version of this patch. > > This is still a _preliminary_ patch. In particular: > > * The compiler currently fails ungracefully if it encounters > (the-environment). > > * The lexical environment object is currently non-opaque list structure. > > * I still wouldn't be surprised if `local-eval' does the wrong thing if > (current-module) is different from what it was when the associated > `primitive-eval' was called.
Before anyone even _defines_ what the "right thing" would be, there is little point in worrying about this. I don't think that `local-eval' 1.8 documented any behavior for this case (well, it did not document any behavior for a lot of cases). So it probably makes sense to look afterwards what will happen without special precautions, and unless that is spectacularly useless or inconsistent, call it the "right thing" by definition. -- David Kastrup