Re: As-binding #-types/Evaluation order & State

Francois Rouaix (Francois.Rouaix@inria.fr)
Fri, 13 Sep 1996 11:24:03 +0200

Message-Id: <199609130924.LAA04829@madiran.inria.fr>
From: Francois Rouaix <Francois.Rouaix@inria.fr>
To: christo@nextsolution.co.jp (Frank Christoph)
Subject: Re: As-binding #-types/Evaluation order & State
Date: Fri, 13 Sep 1996 11:24:03 +0200

Dear Frank,

about the evaluation order question:

> [this is bogus because of right-to-left order]
> #let rec list_of_queue q =
> # try Queue.take q :: list_of_queue q with Queue.Empty -> []

I would have written

let rec list_of_queue q =
try
let h = Queue.take q in
h::list_of_queue q
with
Queue.Empty -> []

in this case, which seems pretty natural.

In general, if I have a doubt about consequences of evaluation order on the
state, say for:
ef e1 e2 en

I'd write (assuming I want left-to-right order of course)
let f = ef in
let x1 = e1 in
...
let xn = en in
ef x1 ... xn

Or did I miss something ?

-- 
Francois.Rouaix@inria.fr                   Projet Cristal - INRIA Rocquencourt
Programming is dreadfully impermanent;  it's more like performance art
than literature -- Bruce Sterling (dixit Wired)