Roger Pack wrote: >>>> Then how it is different from >>>> foo.bar if foo.respond_to?(:bar) >>>> >>>> ? >>> You don't have to write foo and bar twice :) >>> >>> I'm with you in thinking that adding another syntax >>> foo.?bar >>> seems a little much when a new method will do. >>> -=r >> Agree on both points. But what does the new method return? > > I'm not sure. > I'd imagine either nil or the method's return value. > -=r Wouldn't it have to return some special object that simply didn't respond to any messages? foo.if_not_nil.bar Returning nil from #if_not_nil would just cause the same exception we're trying to avoid. Anyway, I'd prefer a special object to a special syntax. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407