Actions
Feature #17347
closedEnumerator::Chain of Enumerator::Lazy should be lazy
Status:
Closed
Assignee:
-
Target version:
-
Description
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
Consider the following script:
a = [1,2,3].lazy
p a
b = [4,5,6].lazy
p b
c = a + b
p c
This gives the output:
#<Enumerator::Lazy: [1, 2, 3]>
#<Enumerator::Lazy: [4, 5, 6]>
#<Enumerator::Chain: [#<Enumerator::Lazy: [1, 2, 3]>, #<Enumerator::Lazy: [4, 5, 6]>]>
Note that c
is just Enumerator::Chain
; but all its component enumerators are lazy, so it would be nice if c
were lazy.
That is, I'd like the output to be:
#<Enumerator::Lazy: [1, 2, 3]>
#<Enumerator::Lazy: [4, 5, 6]>
#<Enumerator::Lazy: #<Enumerator::Chain: [#<Enumerator::Lazy: [1, 2, 3]>, #<Enumerator::Lazy: [4, 5, 6]>]>>
Actions
Like0
Like0Like0Like0Like0