Issue #12110 has been updated by Matthew Kerwin.


Robert A. Heiler wrote:
> Here is the biggest problem:
> 
> - What name would you give it? :)

I seem to recall someone suggesting 'any_and_all?' in the past. Can't remember if I just made that up, though.

----------------------------------------
Feature #12110: Create a method to avoid vacuous truth?
https://bugs.ruby-lang.org/issues/12110#change-57145

* Author: Waldyr de Souza
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
I often find myself running into unexpected results when using #all? for example

[].all? { |e| false } # => true

Even though it's logically correct could we have a method that express the following?

foo.any? && foo.all?(&:bar)



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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>