From: Michal Babej Date: 2009-02-11T06:16:20+09:00 Subject: [ruby-core:21968] Re: [Feature #1122] request for: Object#try Hi, On Sunday 08 of February 2009 11:58:18 David A. Black wrote: > It's a bit punctuation-heavy but I think it's preferable. Of course > the whole thing leaves the question of how to handle ambiguous nils You could slightly modify it to be foo.?bar(*args) : &block as a syntax sugar to: foo.respond?(:bar) ? foo.bar(args) : yield args Or something similar... though i'd probably look awful if you wanted to pass a block to foo.bar :) -- mb