From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA17681; Wed, 11 Sep 2002 10:32:36 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA18002 for ; Wed, 11 Sep 2002 10:32:35 +0200 (MET DST) Received: from tcs.inf.tu-dresden.de (tcs.inf.tu-dresden.de [141.76.75.101]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g8B8WY927628 for ; Wed, 11 Sep 2002 10:32:34 +0200 (MET DST) Received: from ithif51 (ithif51 [141.76.75.51]) by tcs.inf.tu-dresden.de (8.12.6/8.12.6) with ESMTP id g8B8WYgf016052 for ; Wed, 11 Sep 2002 10:32:34 +0200 (MET DST) Received: from tews by ithif51 with local (Exim 3.12 #1 (Debian)) id 17p2vK-0008D8-00 for ; Wed, 11 Sep 2002 10:32:34 +0200 From: Hendrik Tews MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15742.65442.172923.514962@gargle.gargle.HOWL> Date: Wed, 11 Sep 2002 10:32:34 +0200 (CEST) To: caml-list@inria.fr Subject: Re: [Caml-list] eval order and 'and' In-Reply-To: <20020911074753.GA1315@iliana> References: <57C8A9DF.126A17DD.00958B05@netscape.net> <20020911074753.GA1315@iliana> X-Mailer: VM 6.75 under Emacs 20.7.2 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Sven LUTHER writes: Date: Wed, 11 Sep 2002 09:47:53 +0200 Subject: Re: [Caml-list] eval order and 'and' So he can do things like : if x <> 0 and 1 / x ... like it is possible to do in C, instead of doing : if x <> 0 then if 1 / x ... which gives more lines of code, and needs to redefine two time the else condition. Anyway, i don't think the order is defined, but in any case, i guess it would be revere sequential if anything (execution starts from the right). IMO you are mixing things up, "and" is not an operator and if x <> 0 and 1 / x ... is not legal ocaml. For let a = ex1 and b = ex2 ... the manual says that the evaluation is unspecified (6.7.1. local definitions). For the logical operators (&&, &, ||, or) the manual specifies left to right (non-strict) evaluation (Module Pervasives). Bye, Hendrik ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners