From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 8081C1FA7B for ; Wed, 14 Jun 2017 02:51:49 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 2B5351207BA; Wed, 14 Jun 2017 11:51:46 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 685A4120766 for ; Wed, 14 Jun 2017 11:51:43 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=pyDd0xKBa1RruxEwN8YnF3y/Icg=; b=F9lCyjje40UlYkXQJ9 tmN4o3YdQpxD9lguC8sC2yDfh6BkLKTwyKTV3qEmMGQL2X0cxko7c/JS5FQgza0W nKdiFgj1Y8MLovplWVA5H1eDq6zn790hwtWdCIMmO1fsA5VOvQkQ2XNmv1ky/uJD 6oXYKqDPerR3o4+hpef3UtCkw= Received: by filter1129p1mdw1.sendgrid.net with SMTP id filter1129p1mdw1-881-5940A4BB-17 2017-06-14 02:51:39.222076204 +0000 UTC Received: from herokuapp.com (ec2-107-22-91-203.compute-1.amazonaws.com [107.22.91.203]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id rmr64otyRLm2G9W34evzIg for ; Wed, 14 Jun 2017 02:51:39.206 +0000 (UTC) Date: Wed, 14 Jun 2017 02:51:38 +0000 From: shyouhei@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56701 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13657 X-Redmine-Issue-Author: JustJosh X-Redmine-Sender: shyouhei 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7EtlQ9/D/IbQqHU1xANZLrxw1WSh7QkEwMQV AZQc5cSN/rJbCFxS12WKw33y8Do6XCkbHgxlHD6X5M6TMVeUrP7GoX0GKN8uguYK1z59t7PO+T7vSO pDFaIZwr4sQTKW+sAwZUAEo+e71/DI9W3WS978KS/E5e35wxtp3OBLy9yg== X-ML-Name: ruby-core X-Mail-Count: 81675 Subject: [ruby-core:81675] [Ruby trunk Feature#13657][Rejected] Simplify usage of Enumerable#reject 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 #13657 has been updated by shyouhei (Shyouhei Urabe). Status changed from Open to Rejected That's grep_v. ```ruby [1, 2, 3, 4].grep_v(3) # => [1, 2, 4] ``` ---------------------------------------- Feature #13657: Simplify usage of Enumerable#reject https://bugs.ruby-lang.org/issues/13657#change-65364 * Author: JustJosh (Joshua Stowers) * Status: Rejected * Priority: Normal * Assignee: * Target version: ---------------------------------------- The reject method is more complicated than it has to be when removing only a specific value. It would be convenient if we could just plug in the value we wish to delete as an optional argument, for example: ~~~ ruby [1, 2, 3, 4].reject(3) # => [1, 2, 4] ~~~ as apposed to: ~~~ ruby [1, 2, 3, 4].reject { |element| element == 3 } # => [1, 2, 4] ~~~ The next best method I can think of is `#delete`, but that returns the value which is deleted. -- https://bugs.ruby-lang.org/