Project

General

Profile

Actions

Feature #20476

open

Add Enumerator#eager that returns self, like Enumerator::Lazy#lazy

Added by shan (Shannon Skipper) 6 months ago. Updated 6 months ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:117801]

Description

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.

Actions

Also available in: Atom PDF

Like1
Like0