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 3922A1FA7B for ; Mon, 19 Jun 2017 15:28:33 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 34F22120779; Tue, 20 Jun 2017 00:28:32 +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 6BCFF120769 for ; Tue, 20 Jun 2017 00:28:30 +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=5Zb3o+P4XJFZtsXwr4+FxpUzAqU=; b=ryABG0d9NE+xYvQsZo uVu86p/XyYQQUQPEC3OLuhxXCo9jcOoEpkA6rvJ0ZOHplDShFEJXpUSIHLyb7+0P cO+bPOdLb/cvM48CQWOxSvbQq7oIWnEaIuUYHhLoqpxaouldPDbLPeS97XqoLEq0 Ic8iIsg3ZoLhal6TgW7gb2q4c= Received: by filter0906p1mdw1.sendgrid.net with SMTP id filter0906p1mdw1-4375-5947ED82-63 2017-06-19 15:28:02.447959667 +0000 UTC Received: from herokuapp.com (ec2-54-159-32-161.compute-1.amazonaws.com [54.159.32.161]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id a5ydsOufSfeRafiGlFndlA for ; Mon, 19 Jun 2017 15:28:02.435 +0000 (UTC) Date: Mon, 19 Jun 2017 15:28:02 +0000 From: stowers.joshua@live.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56753 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS51uV4c89rYaOKM+YOll9dXBi6pFdEZpWVx24 2qqUMvxH2E4b1gDAwlBIxr9feCztezEqB9+HePMq3welAqCs4KnWUx2vvX9mcK0vKG+6CI3nq+v8NH ojx9wSfA3xO++rLfhYnABoOdb9vAExcz3pWyCPsIM0s4zrpVLFQJ6VINIg== X-ML-Name: ruby-core X-Mail-Count: 81724 Subject: [ruby-core:81724] [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 updated by JustJosh (Joshua Stowers). Great! You're right, that will accomplish this _exactly_. Do you see any hope in adding this functionality to `#reject` regardless of the existence of `#grep_v`? This other method is difficult to make sense of unless the developers are either familiar with it already or have used `grep` extensively enough to recognize its purpose. Adding the functionality would also reduce the number of methods developer's have to know. Also it wouldn't hurt to have. Thanks for pointing out the existence of `#grep_v` ---------------------------------------- Feature #13657: Simplify usage of Enumerable#reject https://bugs.ruby-lang.org/issues/13657#change-65425 * 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/