News for hackers. Stuff that matters.
Re:How is lazy evaluation in Haskell useful? by btilly on Sunday November 25, 2012 @11:55AM (#4828526)
The difficulty depends on the language and on what you're trying to do.

In Python the correct translation is usually to replace return with yield and work with iterators. In a language without that feature, well, http://perl.plover.com/Stream/stream.html demonstrates what a solution looks like in Perl. A Java solution to the same issue is going to be..verbose.

Re:How is lazy evaluation in Haskell useful? by hythloday on Sunday November 25, 2012 @04:55PM (#4829419)
I avoided generators because implementing ersatz laziness with lazy language features seemed like cheating - you can read my Python lists as C arrays, but it's much harder to map that onto coroutines without significant handwaving.