From: sawadatsuyoshi@... Date: 2015-02-22T15:13:49+00:00 Subject: [ruby-core:68228] [Ruby trunk - Feature #10880] Subclassing Array from Enumerator Issue #10880 has been updated by Tsuyoshi Sawada. Marc-Andre Lafortune wrote: > > I use with_index and with_object frequently. > > Any reason why you wouldn't simply use `each_with_index` and `each_with_object`? I want to provide an optional starting number (most often `1`) to the former. ---------------------------------------- Feature #10880: Subclassing Array from Enumerator https://bugs.ruby-lang.org/issues/10880#change-51590 * Author: Tsuyoshi Sawada * Status: Open * Priority: Normal * Assignee: ---------------------------------------- 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/