Issue #5644 has been updated by sunaku (Suraj Kurapati).


Hi Matz,

I didn't ask for antonmys for all predicates; only for #exclude?.

The reason for #exclude? is for more "natural" boolean expressions:

    if File.exist? some_file and some_list.exclude? some_file
    if File.exist? some_file and not some_list.include? some_file

That "not SOMETHING.include? SOMETHING" pattern appears often in my code, so that's why I created this request.  Of course, me saying "appears often" does not constitute as solid evidence in support of adding #exclude? so I have no choice but to accept your judgement on this request.  It's your call.

Thanks for your consideration.
----------------------------------------
Feature #5644: add Enumerable#exclude? antonym
https://bugs.ruby-lang.org/issues/5644#change-25334

Author: sunaku (Suraj Kurapati)
Status: Feedback
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: 
Target version: 


Please add Enumerable#exclude? as antonym of Enumerable#include?

This allows me to construct Boolean expressions more pleasantly:

  if File.exist? some_file and not some_list.include? some_file

Can be written as:

  if File.exist? some_file and some_list.exclude? some_file

Thanks for your consideration.


-- 
http://bugs.ruby-lang.org/