2 ms·
Here are some key aspects of Streams: - Streams are an alternative to generators (yield) - Streams can be used to traverse recursive structures - Streams imp
by vjeux 15y ago
Here are some key aspects of Streams:
- Streams are an alternative to generators (yield)
- Streams can be used to traverse recursive structures
- Streams implementation only require lambda functions with proper closure
- Node.js continuation passing style is a form of Stream
I've implemented streams using continuations. You can also see a bunch of related functions such as: print, map, filter, reduce, range, enumerate, comprehension, traverse, empty, cons, zip, xrange, generator2stream.
http://blog.vjeux.com/2011/javascript/stream-lazy-iteration-with-continuation.html http://blog.vjeux.com/2011/javascript/stream-lazy-iteration-...
Tell me if you have any remark :)