ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: sawadatsuyoshi@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:68224] [Ruby trunk - Feature #10880] Subclassing Array from Enumerator
Date: Sun, 22 Feb 2015 05:14:47 +0000	[thread overview]
Message-ID: <redmine.journal-51585.20150222051447.eeedba8a03899224@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10880.20150221200433@ruby-lang.org

Issue #10880 has been updated by Tsuyoshi Sawada.


Marc-Andre Lafortune wrote:
> 
>     Enumerator.instance_methods - Array.instance_methods
>     # => [:with_index, :with_object, :next_values, :peek_values, :next, :peek, :feed, :rewind] 
> 
> Which method(s) in there do you claim to use frequently?

I use `with_index` and `with_object` frequently.

----------------------------------------
Feature #10880: Subclassing Array from Enumerator
https://bugs.ruby-lang.org/issues/10880#change-51585

* 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/

  parent reply	other threads:[~2015-02-22  5:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-10880.20150221200433@ruby-lang.org>
2015-02-21 20:04 ` [ruby-core:68214] [Ruby trunk - Feature #10880] [Open] Subclassing Array from Enumerator sawadatsuyoshi
2015-02-22  2:24 ` [ruby-core:68221] [Ruby trunk - Feature #10880] " ruby-core
2015-02-22  5:14 ` sawadatsuyoshi [this message]
2015-02-22 15:09 ` [ruby-core:68227] " ruby-core
2015-02-22 15:13 ` [ruby-core:68228] " sawadatsuyoshi
2020-01-04 18:54 ` [ruby-core:96661] [Ruby master Feature#10880] " sawadatsuyoshi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-51585.20150222051447.eeedba8a03899224@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).