Project

General

Profile

This project is closed and read-only.

Actions

Backport #8735

closed

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

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

Added by kachick (Kenichi Kamiya) about 13 years ago. Updated about 13 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: PDF Atom