Hi Stefan,
Here's a use-case to motivate Lazy Iterables (or streams):
Suppose you want to implement rubber-banding on a Canvas. Right now you can't do that elegantly with data binding.
To implement rubber-banding, one must capture MouseDown, MouseMove, and MouseUp. Right now, one might create a state machine object where the object's state is manipulated by each individual event. This gets clumsy and hard to debug fast.
I've thought it would be nice to, on mouse-down, create an Iterable stream tracking MouseMove and MouseUp. MouseUp would be registered as the event terminating the Iterable stream. One could then simply call a function with the coordinates of the MouseDown, along with the Iterable. The function can iterate over the events in the stream, process the rubber-banding operations, and return an "Object created" (or maybe "Objects selected") message when the rubber band operation completes.
The advantage is that all stateful operations stay inside a single function that just loops over an Iterable. You get functional purity in a highly stateful environment.
One could apply the same logic to the Streams API, with the advantage that the looping is also abstracted away (the whole rubber-band operation becomes a reduce over the event stream).
No more time to write tonight.
For calculations, I agree that ComputedValue is nice, and I really like the ideas in the
Cells Manifesto.
Regards,
Dave