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, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, 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 E6F4C1FA7B for ; Wed, 14 Jun 2017 02:40:27 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 891A012079F; Wed, 14 Jun 2017 11:40:25 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 7A24B120766 for ; Wed, 14 Jun 2017 11:40:24 +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=B/6YkeZcz8rZWL+RhO0+BpbQQJY=; b=pXgVV54yYZfTuVIWYZ ZH3gPZFM4popABVSaKnrN+HiSqAhQr5sk/s7HDcCG6FMKFmmdAWnwQqdFdV2xZ84 eDmJgoawiRIX74hl+lmy7No4P8TuV7gkykGYqzCcI/myeFWiqYMlsVUY9jO6Jl8L RqBQ5DizjItIZm9yEL9YC94hU= Received: by filter1183p1mdw1.sendgrid.net with SMTP id filter1183p1mdw1-22310-5940A214-23 2017-06-14 02:40:20.605183465 +0000 UTC Received: from herokuapp.com (ec2-54-234-76-190.compute-1.amazonaws.com [54.234.76.190]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id pIrcZVBDSRixi7cQXxMgfw for ; Wed, 14 Jun 2017 02:40:20.595 +0000 (UTC) Date: Wed, 14 Jun 2017 02:40:19 +0000 From: stowers.joshua@live.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56700 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13657 X-Redmine-Issue-Author: JustJosh X-Redmine-Sender: JustJosh 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7CT2/DsLINXl2LPBh+P0Lv39aZ1zTlDyJm8r GAaILGTBtIfh1a3XSdRcH5NaidxtanehEGXA8km/o1k7nTykr8OU4dAR8dwLaWOSikWPnJ0wNzfX7A kH6rTkwFOhguCogNraCh+7r71XpDBajPNzbzKQlYJO7+eBwDQl5IR5EbDg== X-ML-Name: ruby-core X-Mail-Count: 81673 Subject: [ruby-core:81673] [Ruby trunk Feature#13657] 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 reported by JustJosh (Joshua Stowers). ---------------------------------------- Feature #13657: Simplify usage of Enumerable#reject https://bugs.ruby-lang.org/issues/13657 * Author: JustJosh (Joshua Stowers) * Status: Open * 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/