Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at ocaml.org.

Browse thread
Strange evaluation order
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-19 (13:47)
From: Nicolas Barbulesco <nbarbulesco@y...>
Subject: Re: "ocaml_beginners"::[] Strange evaluation order
> "f exp-1 exp-2" means "(f exp-1) exp-2" that is to say :
> 
> My dear Ocaml machine, please evaluate (f exp-1) and (exp-2) in any order
> that you want, then apply the first result (f exp-1) with the second one
> (exp-2) and send me back the final result. Thanks.

OK, thanks, it's clear. That explains the answer of #trace.

> If you trace the function f, then you'll see that (f exp-1) is evaluated
> before (res-1 res-2), but you don't see in which order res-1 and res-2 are
> evaluated.
> 
> On the other hand, "let res-1 = f exp-1 in let res-2 = exp-2 in res-1
> res-2" means :
> 
> evaluate ... exactly in the order specified ...