[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unspecified order of evaluation in Scheme



Mitch says:
   I would read the phrase "the operator expression and the operand expressions
   are always evaluated with the same evaluation rules" as precluding the
   possibility that different executions of the same procedure call have
   different orders of evaluation.

FWIW, I understand them differently.  I assume it means that, unlike
other dialects of LISP, the operator and operand expressions have the
same (semantic?) evaluation funcition.  That is, Scheme does *not*
have separate function and variable name spaces (for example).

I've also always assumed that one could replace any call to an n-ary
function (i.e. n+1 evaluable positions in the call) with a hairy
expression involving a call to (RANDOM (FACT (+ N 1)) to decide on the
evaluation order ... we've joked about doing exactly this in the MIT
Scheme interpreter since at least 1982.  [The compiler had to be fast,
so we couldn't do it there :-)]

--Jim