Actions
Feature #9602
closedLogic with `Enumerable#grep`
Feature #9602:
Logic with `Enumerable#grep`
Description
Enumerable#grep is useful to filter things:
-
Often, the condition cannot be expressed as a single object on which
===is applied, but as a disjunction over===applied to multiple objects. I would likeEnumerable#grepto take arbitrary number of arguments, and when they are more than one, a logical disjunction applies, just as when there are multiple comma-separated objects afterwhenincasecondition: -
Also, it often happens that I want the negation of grep. Perhaps,
Enumerable#grepv(grepvcomes fromgrep -v) can be implemented as negation ofEnumerable#grep, i.e., select elements for which===returns false on any of the arguments:
Files
Actions