Project

General

Profile

Feature #8825

Symbol Argument to any?

Added by Kyle Decot over 2 years ago. Updated over 2 years ago.

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

Description

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

foo.any?(&:bar)

History

#1 [ruby-core:56837] Updated by Nobuyoshi Nakada over 2 years ago

  • Status changed from Open to Feedback

=begin
Do you mean it is same as this?

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

#2 [ruby-core:56958] Updated by Kyle Decot over 2 years ago

Yes. That's what I was thinking.

#3 [ruby-core:56959] Updated by Charlie Somerville over 2 years ago

  • Status changed from Feedback to Rejected

=begin
This already works:

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

=end

Also available in: Atom PDF