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: Richard Jones <rich@a...>
Subject: Re: [Caml-list] laziness
On Mon, Sep 06, 2004 at 06:35:37PM -0400, Hartmann Schaffer wrote:
> Richard Jones 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?
> > 
> >
> 
> well, programs supposedly run against quite a few different data sets, 
> and depending on the particular data set, some code segments might never 
> be executed

I was really talking about code that would never be executed under any
inputs.

The example was given of:

  let x = ... in let y = ... in x

Under lazy evaluation, "y" is never evaluated, but it's still dead code.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
If I have not seen as far as others, it is because I have been
standing in the footprints of giants.  -- from Usenet