[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84379] [Ruby trunk Feature#14197] `Enumerable#{select, reject}` accept a pattern argument
From:
shevegen@...
Date:
2017-12-20 21:29:43 UTC
List:
ruby-core #84379
Issue #14197 has been updated by shevegen (Robert A. Heiler).
I think this suggestion looks ok, unless I may have missed something.
The main difference Kazuhiro is suggesting, appears to be the shorter
notation via regex given to .reject() rather than use the (longer)
block variant.
Here is the link to #grep:
https://ruby-doc.org/core-2.1.0/Enumerable.html#method-i-grep
which shows one example:
c = IO.constants
c.grep(/SEEK/) #=> [:SEEK_SET, :SEEK_CUR, :SEEK_END]
On a side note, while I have used .grep(), I have never used .grep_v()
and it is a bit mysterious to me what grep_v does from the name
alone. :)
----------------------------------------
Feature #14197: `Enumerable#{select,reject}` accept a pattern argument
https://bugs.ruby-lang.org/issues/14197#change-68568
* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
* Assignee:
* Target version: next minor
----------------------------------------
`#all?`, `#any?`, `#none?`, and `#one?` accept a pattern argument since 2.5.0.
But `#select`, and `#reject` don't.
The features are exist as `#grep`, and `#grep_v`, but there are hard to remember for me when I use `#select`, or `#reject`.
So I want to write
```ruby
collection.reject(/re/)
```
instead of
```ruby
collection.reject {|item| /re/ =~ item }
```
nor
```ruby
collection.grep_v(/re/)
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>