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 KAA30130; Mon, 6 Sep 2004 10:24:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA30364 for ; Mon, 6 Sep 2004 10:24:55 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i868OlQf014524 for ; Mon, 6 Sep 2004 10:24:53 +0200 Received: from [192.168.1.200] (ppp210-32.lns2.syd3.internode.on.net [203.122.210.32]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i868OZHY060908; Mon, 6 Sep 2004 17:54:40 +0930 (CST) Subject: Re: [Caml-list] laziness From: skaller Reply-To: skaller@users.sourceforge.net To: Richard Jones Cc: caml-list In-Reply-To: <20040906005741.GA20406@annexia.org> References: <413879B6@webmail> <20040906005741.GA20406@annexia.org> Content-Type: text/plain Message-Id: <1094459073.3352.987.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 06 Sep 2004 18:24:34 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 413C1ECF.000 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 bug:01 bug:01 eagerly:01 debugging:01 9660:01 glebe:01 nsw:01 snail:02 lazy:02 lazy:02 checkout:02 laziness:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 2004-09-06 at 10:57, Richard Jones wrote: > Doesn't laziness often indicate a bug in the code? ie. You've > written an expression in the program, but that expression is never > used. This is dead code, right? Hence a bug? But that dead code if executed eagerly will result in a value stored in a variable which is never used. So the code is still 'dead code' and still a bug (assuming it is a bug) whether evaluation is eager or lazy. Actually the lazy case might make it easier to track this down by adding a debugging print in the expression -- in the eager case you get a diagnostic but can't deduce the result is used, in the lazy case you know the result is being used when you get the diagnostic. -- 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