[#69084] [Ruby trunk - Feature #11124] [Open] [PATCH] lib/*: use monotonic clock for timeouts — normalperson@...
Issue #11124 has been reported by Eric Wong.
5 messages
2015/05/06
[#69138] [Ruby trunk - Feature #11136] [PATCH] webrick: avoid fcntl module — nobu@...
Issue #11136 has been updated by Nobuyoshi Nakada.
3 messages
2015/05/12
[#69160] [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start — nobu@...
Issue #11146 has been updated by Nobuyoshi Nakada.
4 messages
2015/05/13
[#69175] Re: [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start
— Eric Wong <normalperson@...>
2015/05/13
nobu@ruby-lang.org wrote:
[ruby-core:69195] [Ruby trunk - Feature #11049] [Closed] Enumerable#grep_v (inversed grep)
From:
her@...
Date:
2015-05-14 10:44:15 UTC
List:
ruby-core #69195
Issue #11049 has been updated by Shota Fukumori.
Status changed from Open to Closed
Thanks, committed at r50491, r50492.
----------------------------------------
Feature #11049: Enumerable#grep_v (inversed grep)
https://bugs.ruby-lang.org/issues/11049#change-52449
* Author: Shota Fukumori
* Status: Closed
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
sometime I want to do `grep -v` like operation:
%w(aaa bbb ccc).reject { |x| /b/ === x } #=> ["aaa", "ccc"]
We already have Enumerable#grep, so I propose to add Enumerable#grep_v.
%w(aaa bbb ccc).grep(/b/) #=> ["bbb"]
%w(aaa bbb ccc).grep_v(/b/) #=> ["aaa", "ccc"]
## Naming / Interface
This idea is mentioned at DevelopersMeeting20150408Japan by me. Matz has said "I don't disagree for the feature. So this remains naming (interface) problem."
I'm not sure grep_v is the best name for this feature; feedback are welcomed.
### Ideas
- `grep_v(pattern)` (the first patch)
- `grep(pattern, inverse: true)`
- `grep!(pattern)`
---Files--------------------------------
grepv.patch (4.24 KB)
--
https://bugs.ruby-lang.org/