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 JAA16435; Wed, 11 Sep 2002 09:40:34 +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 JAA16601 for ; Wed, 11 Sep 2002 09:40:33 +0200 (MET DST) Received: from mel-rto2.wanadoo.fr (smtp-out-2.wanadoo.fr [193.252.19.254]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g8B7eW926253 for ; Wed, 11 Sep 2002 09:40:32 +0200 (MET DST) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto2.wanadoo.fr (6.5.007) id 3D760C96003E1537; Wed, 11 Sep 2002 09:39:59 +0200 Received: from iliana (80.9.104.216) by mel-rta7.wanadoo.fr (6.5.007) id 3D775ADD002EB4B0; Wed, 11 Sep 2002 09:39:59 +0200 Received: from luther by iliana with local (Exim 3.35 #1 (Debian)) id 17p2E5-0000LN-00; Wed, 11 Sep 2002 09:47:53 +0200 Date: Wed, 11 Sep 2002 09:47:53 +0200 To: Arturo Borquez Cc: Chris Hecker , caml-list@inria.fr Subject: Re: [Caml-list] eval order and 'and' Message-ID: <20020911074753.GA1315@iliana> References: <57C8A9DF.126A17DD.00958B05@netscape.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57C8A9DF.126A17DD.00958B05@netscape.net> User-Agent: Mutt/1.4i From: Sven LUTHER Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Sep 11, 2002 at 01:05:46AM -0400, Arturo Borquez wrote: > Chris Hecker wrote: > > > > >Does "let a and b in" guarantee a is evaluated before b, like "let a in let > >b in" does? > > > Sorry but I don't understand the purpose of your question. > If a and b are functions with 'related side effects' the secure > way should be the later ('let a in let b ..'), otherwise > the order of evaluation in the first case is irrelevant > as a and b are two unrelated functions (with no side effects), > or 'let a and b in ..' is the same as 'let b and a in ..' 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). But then again, it could be different in bytecode and in native code. Friendly, Sven Luther ------------------- 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