Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Fix Version/s: 1.5.5, 1.6-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
[1,2,3].sum() works nicely.
But [1,2,3].iterator().sum() fails.
In contrast, this code
[1,2,3].iterator().each {
println it
}
works just fine.
On aesthetic grounds, there shouldn't be any difference in what works and what doesn't. More importantly, there are situations where an iterator is available (due to pre-existing API's) but a collection is not.
Here are some simple test cases for this enhancement.