https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-06-14T02:51:38ZRuby Issue Tracking SystemRuby master - Feature #13657: Simplify usage of Enumerable#rejecthttps://bugs.ruby-lang.org/issues/13657?journal_id=653642017-06-14T02:51:38Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>That's grep_v.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">].</span><span class="nf">grep_v</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># => [1, 2, 4]</span>
</code></pre> Ruby master - Feature #13657: Simplify usage of Enumerable#rejecthttps://bugs.ruby-lang.org/issues/13657?journal_id=654252017-06-19T15:28:01ZJustJosh (Joshua Stowers)
<ul></ul><p>Great! You're right, that will accomplish this <em>exactly</em>.</p>
<p>Do you see any hope in adding this functionality to <code>#reject</code> regardless of the existence of <code>#grep_v</code>?<br>
This other method is difficult to make sense of unless the developers are either familiar with it already or have used <code>grep</code> extensively enough to recognize its purpose.</p>
<p>Adding the functionality would also reduce the number of methods developers have to know.<br>
Also it wouldn't hurt to have.</p>
<p>Thanks for pointing out the existence of <code>#grep_v</code></p> Ruby master - Feature #13657: Simplify usage of Enumerable#rejecthttps://bugs.ruby-lang.org/issues/13657?journal_id=654282017-06-19T22:46:42Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>I guess this request is a variant of <a href="https://bugs.ruby-lang.org/issues/11286" class="external">https://bugs.ruby-lang.org/issues/11286</a> (if not identical). You would like to join the thread which is still open, i.e there are chances to introduce your request.</p>