From: shyouhei@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:81728] [Ruby trunk Feature#13657] Simplify usage of Enumerable#reject
Date: Mon, 19 Jun 2017 22:46:42 +0000 [thread overview]
Message-ID: <redmine.journal-65428.20170619224642.e162d26ea0f01bb6@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13657.20170614024019@ruby-lang.org
Issue #13657 has been updated by shyouhei (Shyouhei Urabe).
I guess this request is a variant of https://bugs.ruby-lang.org/issues/11286 (if not identical). You would like to join the thread which is still open, i.e there are chances to introduce your request.
----------------------------------------
Feature #13657: Simplify usage of Enumerable#reject
https://bugs.ruby-lang.org/issues/13657#change-65428
* 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/
prev parent reply other threads:[~2017-06-19 22:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-13657.20170614024019@ruby-lang.org>
2017-06-14 2:40 ` [ruby-core:81673] [Ruby trunk Feature#13657] Simplify usage of Enumerable#reject stowers.joshua
2017-06-14 2:51 ` [ruby-core:81675] [Ruby trunk Feature#13657][Rejected] " shyouhei
2017-06-19 15:28 ` [ruby-core:81724] [Ruby trunk Feature#13657] " stowers.joshua
2017-06-19 22:46 ` shyouhei [this message]
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-65428.20170619224642.e162d26ea0f01bb6@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).