Issue #1122 has been updated by Thomas Sawyer.


How about just `respond` ?

    foo.respond(:bar)

And really, there's no reason it can't support delegation style *too*.

    foo.respond.bar

This later form will be slower of course because it has to create an intermediate delegator --at least until Ruby has some "high-order function" capability built-in (*hint* *hint*). But it's certainly the nicer notation in most cases.

----------------------------------------
Feature #1122: request for: Object#try
https://bugs.ruby-lang.org/issues/1122#change-24609

Author: Narihiro Nakamura
Status: Rejected
Priority: Normal
Assignee: Narihiro Nakamura
Category: core
Target version: 2.0.0


=begin
 Hi.
 
 Object#try is new feature of rails2.3.
 
 http://guides.rubyonrails.org/2_3_release_notes.html
 http://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/try.rb
 http://ozmm.org/posts/try.html
 
 Matz said: "OK, good name is the last problem."
 
 Anyone has better name?
 
 thanks.
 
 ---
 Narihiro Nakamura
=end



-- 
http://bugs.ruby-lang.org/