[ruby-core:73986] [Ruby trunk Feature#12110] Can create a method to avoid vacuous truth?

From: waldyr.ar@...
Date: 2016-02-25 16:30:14 UTC
List: ruby-core #73986
Issue #12110 has been reported by Waldyr de Souza.

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

* 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 like 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>

In This Thread

Prev Next