Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] laziness
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <ocaml-erikd@m...>
Subject: Re: [Caml-list] laziness
On Mon, 6 Sep 2004 01:57:41 +0100
Richard Jones <rich@annexia.org> wrote:

> One thing that worries me about laziness.
> 
> 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?

Not necessarily, but I'm not 100 sure I can justify that.

Consider mathematical code that uses lazy evaluation. Certain
expressions might be expressed in terms of an infinite sum of
terms. It would also be possible to have two expressions
declared like this, divide one by the other and have something
which when evaluated results in a finite constant and without 
even trying to evaluate the two infinite sums.

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam@mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"I don't think any MS Exec will ever die of old age. Satan
doesn't need the competition."
-- Digital Wokan on LinuxToday.com

-------------------
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