On 29/03/2008, Kris Zyp <[EMAIL PROTECTED]> wrote:
> I think Neil's inspiring demonstration of pseudo-threading with generators
> is also worthy of inclusion in your list of generator use cases:
> http://www.neilmix.com/2007/02/07/threading-in-javascript-17/
That code can be written without generators. In general whenever the
code in the examples from the blog does yield, one can replace that
with "return function() { the rest of code from the function}". But
this would require to replace imperative loops from the examples by
recursive functions.
This shows that if one programs in a functional style, then generators
are not that useful. But they are valuable if the code uses explicit
loops etc. Plus with generators one can assume certain time and space
complexity bounds in ES4 which is not the case for functional code in
the view of deferred tail call proposal.
Regards, Igor
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss