Project

General

Profile

Actions

Feature #13606

closed

Enumerator equality and comparison

Added by glebm (Gleb Mazovetskiy) over 7 years ago. Updated about 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:81426]

Description

In Ruby, most objects are compared by value. What do you think about Enumerators following the same pattern? I think this would greatly increase the expressiveness of Ruby.

Proposal:

Two Enumerators should be considered equal (==) if they yield the same number of elements and these elements are equal (==).
If both of the Enumerators are infinite, the equality operator never terminates.
<=> should be handled similarly.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0