stdEnumerator #25
Labels
enhancement
New feature or request
lib-stdEnumerator
megathread
Many bundled feature requests for an individual class
GENERAL FEATURES
CONSTRUCTORS
stdEnumerator
- BetterCreateFromIEnumVariant()
#54INSTANCE PROPERTIES
INSTANCE METHODS
Many methods were inspired by those in Ruby's Enumerable: https://ruby-doc.org/core-2.7.2/Enumerable.html
[1,2,3,4,5].each_cons(2,cb)
==>[[1,2],[2,3],[3,4],[4,5]]
[1,2,3,4,5].each_slice(2,cb)
==>[[1,2],[3,4],[5]]
[1,2,3,4,5,6].partition(a=>a%2=0)
==>[[2,4,6],[1,3,5]]
[1,2,3].zip([4,5,6]) ==> [[1,4],[2,5],[3,6]]
[1,2,3].zip([1,2]) ==> [[1,1],[2,2],[3,null]]
[1,2,3,4,5].eachFixedLengthCombination(cb, 3) ==> [[1,2,3],[1,2,4],[1,2,5], ... [3,4,5]]
WHAT WE WON'T DO:
with_index
- this can't be easily done, so instead implement methods like `forEach(cb,withIndex?=false)with_object
- this can be done with cb.Bind()Things we can't do (yet)
The text was updated successfully, but these errors were encountered: