From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.8 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 61F321F463 for ; Sat, 4 Jan 2020 18:54:52 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id ADA6D1209FC; Sun, 5 Jan 2020 03:54:38 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5586D1209E7 for ; Sun, 5 Jan 2020 03:54:36 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-72qfl with SMTP id filterdrecv-p3mdw1-56c97568b5-72qfl-18-5E10DF73-22 2020-01-04 18:54:43.986669031 +0000 UTC m=+1620696.842524479 Received: from herokuapp.com (unknown [3.84.47.179]) by ismtpd0036p1iad2.sendgrid.net (SG) with ESMTP id JLXcANKMSBG9MkB_IoylBg for ; Sat, 04 Jan 2020 18:54:43.963 +0000 (UTC) Date: Sat, 04 Jan 2020 18:54:44 +0000 (UTC) From: sawadatsuyoshi@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72323 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 10880 X-Redmine-Issue-Author: sawa X-Redmine-Sender: sawa X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?jFXA8Rt481sXUUIO9tYW1AJlMOZdNdlSw=2F5TfLCefGuisqxkxvBOf198wBzuy8?= =?us-ascii?Q?9y6p07JL7N8byjou1DB7Z0yzzKd3=2F1qDTm5CIkY?= =?us-ascii?Q?=2F5GXcIAA7ygHq9Fnwp53=2FfRNYXPShBf9iCiII0f?= =?us-ascii?Q?kUqZleZ20Sq8uYFAM0Im5FO7GQ+XF6l427p34Jz?= =?us-ascii?Q?ekTXpvpl4teBC14s7Ms+jusaTCqOXtnM5ubnxi=2F?= =?us-ascii?Q?F0e7Z1OAXtrzNuYas=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96661 Subject: [ruby-core:96661] [Ruby master Feature#10880] Subclassing Array from Enumerator X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/