[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: order of evaluation
This page is part of the web mail archives of SRFI 86 from before July 7th, 2015. The new archives for SRFI 86 contain all messages, not just those from before July 7th, 2015.
> As I don't think that the <some unspecified
order> of LET means a pure random
> order that is neither sequential from left to right nor sequential
> to left, I wonder what the rationale for <unspecified order>
evaluation of LET
The rationale for <unspecified order> in LET
is that LET is
essentially a special case of procedure application,
(LET ((a X) (b Y)) (f a b)) => ((LAMBDA (a b) (f
a b)) X Y),
and the order of evaluation of argument expressions
rocedure application is unspecified as well in R5RS.
Now the rationale for <unspecified order> in
...not really obvious to me, either. My guess:
a) Theory people like it big time because the order
evaluation of argument expressions is a non-essential
feature of the model, and would have to be introduced
into the semantics artificially afterwards.
b) Implementations are free to choose the internal
representation of argument lists, and hence also the
algorithms for evaluating these expressions.
What good this actually does in practice you have
somebody else, but since <unspecified order>
is a given in
Scheme/R5RS one can better be very careful not to
some particular order because that is major portability
Anyhow, since the existing implementation do not agree
order of evaluation of arguments the chance that it
fully specified in R^nRS, for some n > 5, are zero.
That is the reason I usually preserve the indeterminism
when introducing binding constructs---although I agree
your point of view that it shouldn't be there in the