[#68845] [Ruby trunk - Feature #11056] [PATCH] lib/net/*: use io/wait methods instead of IO.select — normalperson@...
Issue #11056 has been updated by Eric Wong.
3 messages
2015/04/11
[#68945] [Ruby trunk - Feature #11083] [Open] Gemify net-telnet — shibata.hiroshi@...
Issue #11083 has been reported by Hiroshi SHIBATA.
4 messages
2015/04/21
[#68951] Re: [Ruby trunk - Feature #11083] [Open] Gemify net-telnet
— Eric Wong <normalperson@...>
2015/04/21
shibata.hiroshi@gmail.com wrote:
[#69012] [Ruby trunk - Feature #11105] [Open] ES6-like hash literals — shugo@...
Issue #11105 has been reported by Shugo Maeda.
5 messages
2015/04/29
[ruby-core:68812] [Ruby trunk - Feature #11049] Enumerable#grep_v (inversed grep)
From:
akr@...
Date:
2015-04-08 11:42:02 UTC
List:
ruby-core #68812
Issue #11049 has been updated by Akira Tanaka.
Recursive Madman wrote:
> Benoit Daloze wrote:
> > That only works for some regexps, I doubt there is a proper and well defined inverted regexp for any Regexp.
>
> Could you provide an example that doesn't work?
```
class Regexp
def invert
self.class.new("[^(?:#{source})]")
end
end
%w(aaa bbb ccc).grep(/abc/) #=> []
%w(aaa bbb ccc).grep(/abc/.invert) #=> []
```
----------------------------------------
Feature #11049: Enumerable#grep_v (inversed grep)
https://bugs.ruby-lang.org/issues/11049#change-52079
* Author: Shota Fukumori
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
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/