From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA21158 for caml-red; Thu, 5 Oct 2000 20:26:56 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA07593 for ; Thu, 5 Oct 2000 20:14:11 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e95IEAP08261 for ; Thu, 5 Oct 2000 20:14:10 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id LAA07439 for ; Thu, 5 Oct 2000 11:14:08 -0700 (PDT) Date: Thu, 5 Oct 2000 11:14:08 -0700 (PDT) From: Brian Rogoff To: caml-list@inria.fr Subject: Undefined evaluation order Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr Hi, It is well known that OCaml has undefined evaluation orders and that it uses right-to-left ordering. What is the rationale for that decision? I remember some discussion of this but I couldn't find it in the Caml list archives. Besides being surprising for lots of people, it is actually a little ugly to have to write explicit let bindings to force the order and when reading files which consist of long records; for instance I much prefer type date = { year : int ; month : int ; day : int ; hour : int ; minute : int ; second : int } let input_date igds = { year = input_word igds ; month = input_word igds ; day = input_word igds ; hour = input_word igds ; minute = input_word igds ; second = input_word igds } to let input_date igds = let year = input_word igds in let month = input_word igds in let day = input_word igds in let hour = input_word igds in let minute = input_word igds in let second = input_word igds in { year = year ; month = month ; day = day ; hour = hour ; minute = minute ; second = second } or even with right-to-left where the order is exactly the opposite of the record definition (and of what most readers expect). -- Brian