7 Matching Annotations
- Sep 2023
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
I think this is the crux of the issue. Because #inject needs to evaluate every element in order to return a meaningful value, it can't be partially evaluated. The "scan" operation allows for partial evaluation.
-
- Jul 2020
-
www.ruby-lang.org www.ruby-lang.org
-
Enumerable#tally is added. It counts the occurrence of each element. ["a", "b", "c", "b"].tally #=> {"a"=>1, "b"=>2, "c"=>1}
-
Enumerator::Lazy#eager is added. It generates a non-lazy enumerator from a lazy enumerator.
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
An even more straightforward way is to use group_by
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
If you answer is yes, then we are doing this wrong because subset? or part_of method should be in a parent class (maybe Enumerable class ) in order for it to work for subset, array, hash and any data structure that inherit from it Enumerable.
-
-
github.com github.com