Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Groovy 3 and 4 added some Stream extension methods like plus, toList and toArray. And some default type conversions like String[] array = stream;. This could be taken further by having spread-dot and subscript support:
stream*.thing // --> stream.map(it -> it.thing).toList() stream[1] // --> stream.skip(1).findFirst().orElse(null) stream[1..<10] // --> stream.skip(1).limit(10-1).toList() // consider negative indexes and reverse ranges
Also, forEachPair and zip extension methods would be useful for processing corresponding streams.
Attachments
Issue Links
- is related to
-
GROOVY-8133 Static type checking failure for streams and spread operator
- Closed
- relates to
-
GROOVY-10476 STC: for-each loop on iterable-like types
- Closed
-
GROOVY-10666 Implement multiple-assignment (aka destructuring) via getAt(IntRange) or iterator()
- Closed
- links to