Hi All,
I was going through the paper's lazy evaluation section where the
square root example is given. It occurred to me that one could
implement it in a modular way with just higher order functions
(without the need for lazy evaluation that is).
function f (within, eps, next, a0){
Hi,
Let us try to rewrite the code in a more java-esque syntax:
It translates to something like the below generic method. Correct?
static T T function(IBoundsCheckT within, DeltaT eps, IteratorT
iterator, T initValue){
T currVal = initVal;
while(iterator.hasNext()){
T nextVal
Hi,
Let us try to rewrite the code in a more java-esque syntax:
It translates to something like the below generic method. Correct?
static T T function(IBoundsCheckT within, DeltaT eps, IteratorT
iterator, T initValue){
T currVal = initVal;
while(iterator.hasNext()){
T
On Tue, Oct 05, 2010 at 07:37:32PM +0530, C K Kashyap wrote:
Hi,
Let us try to rewrite the code in a more java-esque syntax:
It translates to something like the below generic method. Correct?
static T T function(IBoundsCheckT within, DeltaT eps, IteratorT
iterator, T initValue){
I see ... I think I understand now.
hmmm ... I am little disappointed though - does that mean that all
the laziness cool stuffs can actually be done using
iterators(generators)?
As in, but for the inconvenient syntax, you can do it all in - say java?
Yes. It would slightly easier in, say,
Yes. It would slightly easier in, say, C# or C++.
I think 'D' achieves its implementation of the 'lazy' keyword using a
similar approach.
But I did not understand why you are disappointed ?
The disappointment was not on a serious note ... the thing is, I
constantly run into discussions
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 10/5/10 10:52 , C K Kashyap wrote:
And I had built up this impression that laziness distinguished Haskell
by a huge margin ... but it seems that is not the case.
Hence the disappointment.
Haskell is lazy-by-default and designed around lazy