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 NAA09971; Sat, 4 Sep 2004 13:22:37 +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 NAA09742 for ; Sat, 4 Sep 2004 13:22:32 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i84BMTEn002271 for ; Sat, 4 Sep 2004 13:22:31 +0200 Received: from [192.168.1.200] (ppp192-107.lns1.syd2.internode.on.net [203.122.192.107]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i84BLAHY084527; Sat, 4 Sep 2004 20:51:20 +0930 (CST) Subject: Re: [Caml-list] laziness From: skaller Reply-To: skaller@users.sourceforge.net To: "Marcin 'Qrczak' Kowalczyk" Cc: caml-list@pauillac.inria.fr In-Reply-To: <87656u2zrk.fsf@qrnik.zagroda> References: <1094279400.3352.240.camel@pelican.wigram> <87656u2zrk.fsf@qrnik.zagroda> Content-Type: text/plain Message-Id: <1094296869.3352.280.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 04 Sep 2004 21:21:10 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4139A575.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 marcin:01 'qrczak':01 kowalczyk:01 sourceforge:01 inlined:01 inlining:01 conforms:01 unspecified:01 inlining:01 9660:01 glebe:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 2004-09-04 at 18:40, Marcin 'Qrczak' Kowalczyk wrote: > skaller writes: > > > However if the call is *inlined* to get > > > > if c' then a' else b' > > > > then perhaps a' or b' will never be evaluated. > > No. Inlining is considered an optimization, which implies that it > doesn't change the semantics except when it was not fully specified > in the first place. I understand that argument -- but that doesn't mean the compiler conforms to the specification, nor that the specification is best. > E.g. the order of evaluation of arguments is > unspecified, so it might be different depending on inlining; but > OCaml does specify that each argument are evaluated exactly once > and inlining doesn't change that. Must they be evaluated before the function is called? -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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