Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
grep currently works on collections, but it would be nice to have it work on Iterators
We could then do lazy things like:
// Set our initial value def a = 1 // Define an iterator around this value def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator // Define a new iterator that will just emit odd numbers def oddIter = iter.grep { it % 2 } // Check it's working assert [ 1, 3, 5 ] == oddIter.take( 3 ).collect()
Activity
blackdrag blackdrag
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | blackdrag blackdrag [ blackdrag ] | |
| Resolution | Won't Fix [ 2 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |