[ruby-core:117801] [Ruby master Feature#20476] Add Enumerator#eager that returns self, like Enumerator::Lazy#lazy

Issue #20476 has been reported by shan (Shannon Skipper). ---------------------------------------- Feature #20476: Add Enumerator#eager that returns self, like Enumerator::Lazy#lazy https://bugs.ruby-lang.org/issues/20476 * Author: shan (Shannon Skipper) * Status: Open ---------------------------------------- I'd like to propose adding an Enumerator#eager method. We currently have Enumerator#lazy, Enumerator::Lazy#lazy, Enumerator::Lazy#eager, but not Enumerator#eager. I like that you can always call `enum.lazy` with any type of Enumerator since a lazy Enumerator will just return itself. This PR just adds an equivalent `enum.eager` for eager Enumerators. I've found it handy to be able to call `.lazy` to ensure that I have a lazy Enumerator and would like to be able to do the same with `.eager`, which currently is only implemented on Enumerator::Lazy. -- https://bugs.ruby-lang.org/

Issue #20476 has been updated by shan (Shannon Skipper). Added a PR https://github.com/ruby/ruby/pull/10739 ---------------------------------------- Feature #20476: Add Enumerator#eager that returns self, like Enumerator::Lazy#lazy https://bugs.ruby-lang.org/issues/20476#change-108207 * Author: shan (Shannon Skipper) * Status: Open ---------------------------------------- I'd like to propose adding an Enumerator#eager method. We currently have Enumerator#lazy, Enumerator::Lazy#lazy, Enumerator::Lazy#eager, but not Enumerator#eager. I like that you can always call `enum.lazy` with any type of Enumerator since a lazy Enumerator will just return itself. This PR just adds an equivalent `enum.eager` for eager Enumerators. I've found it handy to be able to call `.lazy` to ensure that I have a lazy Enumerator and would like to be able to do the same with `.eager`, which currently is only implemented on Enumerator::Lazy. -- https://bugs.ruby-lang.org/
participants (1)
-
shan (Shannon Skipper)