Feature #8825

Symbol Argument to any?

Added by Kyle Decot 8 months ago. Updated 8 months ago.

[ruby-core:56833]
Status:Rejected
Priority:Normal
Assignee:-
Category:core
Target version:-

Description

It would be nice if any? could take a symbol much like map. For example:

foo.any?(&:bar)

History

#1 Updated by Nobuyoshi Nakada 8 months ago

  • Status changed from Open to Feedback

=begin
Do you mean it is same as this?

foo.any? {|e| e.bar}
=end

#2 Updated by Kyle Decot 8 months ago

Yes. That's what I was thinking.

#3 Updated by Charlie Somerville 8 months ago

  • Status changed from Feedback to Rejected

=begin
This already works:

[1,2,3].any?(&:even?)

=end

Also available in: Atom PDF