Project

General

Profile

Actions

Bug #9022

closed

all? method in empty array should return false

Added by lucascaton (Lucas Caton) over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
[ruby-core:57860]

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 1 (0 open1 closed)

Is duplicate of Ruby master - Feature #8723: Array.any? predicate returns true for empty array.RejectedActions

Updated by phluid61 (Matthew Kerwin) over 10 years ago

This is a duplicate of #8723

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Rejected

Updated by alexeymuranov (Alexey Muranov) over 10 years 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).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0