On Mon, 12 Mar 2007, Abdulaziz Ghuloum wrote:

I guess it depends on how you read the following (quoted from 6.1 of R5.92RS):

The variable-definition right-hand-side expressions are evaluated from left
to right, as if in an implicit letrec*, and the body expressions are also
evaluated from left to right after the variable-definition right-hand-side
expressions. A fresh location is created for each exported variable and
initialized to the value of its local counterpart. The effect of returning
twice to the continuation of the last body expression is unspecified.

The paragraph does not specify when the fresh locations for the exported variables are initialized. If every exported location is assigned immediately after its local counterpart is defined, then the values stored in both locations will be consistent (even when returning twice). This is also true if your implementation strategy is to skip local definitions altogether and just use one global location
for each library definition.

If you read the above paragraph as saying that all variable's global locations are initialized together, in one go, after all the local variables are defined, then
you'll get into the inconsistent state and invalid assignment to an immutable
binding that Kent described.

Closing the loophole as recommended by Kent would erase all observable
differences between these three strategies, so that they would become
equivalent, correct?

If true, that would appear to be another good reason to adopt the recommendation.

Andre



_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to