Project

General

Profile

Actions

Feature #8723

closed

Array.any? predicate returns true for empty array.

Added by nurettin (Nurettin Onur TUGCU) almost 11 years ago. Updated over 2 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:56333]

Description

Are all your children redheaded?
Would this be true if you have no children?
I have no children, therefore none of my children are redheaded.
Therefore
[].any?{ true } == true makes no sense.
Expected behavior:
[].any?{ true } == false because the array is empty.


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Bug #9022: all? method in empty array should return falseRejected10/15/2013Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0