Bug #9022

all? method in empty array should return false

Added by Lucas Caton 6 months ago. Updated 6 months ago.

[ruby-core:57860]
Status:Rejected
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

This is expected:

[].any?(&:whatever?)

=> false

But this is not the behavior which I expect:

[].all?(&:whatever?)

=> true

Do you agree with me?


Related issues

Duplicates CommonRuby - Feature #8723: Array.any? predicate returns true for empty array. Rejected 08/02/2013

History

#1 Updated by Matthew Kerwin 6 months ago

This is a duplicate of #8723

#2 Updated by Nobuyoshi Nakada 6 months ago

  • Status changed from Open to Rejected

#3 Updated by Alexey Muranov 6 months ago

Since commenting on the other thread, i have leant that the proposed interpretation of the "for all" quantifier is apparently called "existential import" and apparently was a matter of debate in the 19th century (http://en.wikipedia.org/wiki/Syllogism#Existential_import for example).

Also available in: Atom PDF