2011/1/20 <ghazel / gmail.com>: > Have you all seen try? > > https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/try.rb > > You can do: > > obj.try(:somePropertyName).try(:anotherGreatPropertyName).try(:anotherOne) > > -Greg Yes, #try is an implementation of that idea. But as I said, there is no was to cut trough the call-chain. Say obj=nil, then #try will still get called 3 times. If it was implemented on the syntax level, then ruby could handle the shorted paths. In practice it doesn't really matter though.