On Mon, Jul 26, 2010 at 2:42 AM, Maciej Piechotka <[email protected]> wrote: > > I'm sorry but I fail to see how does it work. Could you show what > exactly map or other transformation would look like (even in terms of > interface?).
* Iterable.map() would return View object that holds an iterator and a list of [function, closure] pairs, where function is either `map` or `filter` (or maybe split `filter` into `select` and `reject`). * View.map(closure) would add the closure to the chain. * Calling `next` on the View would call `next` on the iterator, retrieve the value and apply the chain of operations to it, then yield it. Having a single View with a chain of operations rather than a nested set of Views each with a single operation makes implementing `filter` easier, even though nesting Views has more conceptual elegance. Not sure how fast this would be, but it's very space-efficient. martin _______________________________________________ libgee-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/libgee-list
