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

Re: order of evaluation



Sebastian Egner scripsit:

> Now the rationale for <unspecified order> in procedure
> application is...
> 
> ...not really obvious to me, either. My guess:
> 
> a) Theory people like it big time because the order of
> 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.

The C language allows the same freedom to implementors, and
probably for the same reasons: on some machines it's faster
to evaluate LTR, on others RTL is better, depending on the
natural growth direction of the stack.

C has a mild advantage over Scheme in this area, in that
Scheme systems are compelled to treat a variable
number of arguments as a Scheme list, whereas C uses
magic syntax to provide access to such arguments.

(This is the only place in which a Scheme datatype is
actually exposed other than through the standard library.)

-- 
John Cowan   www.ap.org   www.ccil.org/~cowan   cowan@xxxxxxxx
Lope de Vega: "It wonders me I can speak at all.  Some caitiff rogue did
rudely yerk me on the knob, wherefrom my wits still wander."
An Englishman: "Ay, a filchman to the nab betimes 'll leave a man  
crank for a spell." --Harry Turtledove, Ruled Britannia