[ruby-core:66260] [ruby-trunk - Feature #10506] [Open] Imprve Enumerator.any? behavior

From: ts@...
Date: 2014-11-13 12:40:33 UTC
List: ruby-core #66260
Issue #10506 has been reported by Thomas Sevestre.

----------------------------------------
Feature #10506: Imprve Enumerator.any? behavior
https://bugs.ruby-lang.org/issues/10506

* Author: Thomas Sevestre
* Status: Open
* Priority: Normal
* Assignee:=20
* Category:=20
* Target version:=20
----------------------------------------
IMHO the API `Enumerable.any?` behavior could be improved in the following =
manner:

    any? { |obj| block } =E2=86=92 true or false
    any? =E2=86=92 an_enumerator=20

This would allow to do things like

    [].any?.with_index { |obj, index| }

And it would be more consistent with collect and other Enumerable functions:

    collect { |obj| block } =E2=86=92 array
    collect =E2=86=92 an_enumerator





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

In This Thread

Prev Next