Project

General

Profile

Actions

Backport #8735

closed

Enumerator::Lazy#zip behaves differently from Enumerable#zip when yield with non-single argument

Added by kachick (Kenichi Kamiya) over 10 years ago. Updated over 10 years ago.


Description

=begin
Is this intended?

obj = Object.new
def obj.each
yield
yield 1, 2
end

obj.to_enum.zip(obj.to_enum) #=> [[nil, nil],
# [[1, 2], [1, 2]]]

obj.to_enum.lazy.zip(obj.to_enum).force #=> [[false, nil],
# [1, [1, 2]]]
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0