[ruby-core:96661] [Ruby master Feature#10880] Subclassing Array from Enumerator
[email protected] Sat, 04 Jan 2020 18:54:44 +0000 (UTC)
| Newsgroups | gmane.comp.lang.ruby.core |
|---|---|
| Message-ID | <redmine.journal-83631.20200104185443.bbf7cf414220b5b5@ruby-lang.org> |
Issue #10880 has been updated by sawa (Tsuyoshi Sawada). I should use `each_with_index` and `each_with_object` as marcandre suggests. I withdraw this. Please close this issue. ---------------------------------------- Feature #10880: Subclassing Array from Enumerator https://bugs.ruby-lang.org/issues/10880#change-83631 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- It often happens that I want to use a method from the `Enumerator` class on an array, and so I frequently use `Array#to_enum`. Since `Array` and `Enumerator` share the same parent `Enumerable`, they should be very close. I think it would be convenient if `Array` inherits from `Enumerator`. (Perhaps the same thing can be said for `Hash` too) -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>