From: "shan (Shannon Skipper) via ruby-core" Date: 2024-05-07T23:25:07+00:00 Subject: [ruby-core:117802] [Ruby master Feature#20476] Add Enumerator#eager that returns self, like Enumerator::Lazy#lazy 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/