From: Tim Fletcher Date: 2006-12-06T22:45:38+09:00 Subject: Re: How do I catch a missing method on a passed block? Ah, see what you mean now :) Martin DeMello wrote: > On 12/6/06, Tim Fletcher wrote: > > Logan Capaldo wrote: > > > > > > > If ruby were common lisp, that could actually work. But it's not and our > > > exceptions are not resuamble :). > > > > class Foo > > def bar > > yield > > rescue NameError => method_call > > p method_call.name > > end > > end > > > > Foo.new.bar { baz } > > Breaks: > > irb(main):008:0> a = Foo.new > => # > irb(main):009:0> a.bar { baz } > :baz > => nil > irb(main):010:0> a.bar { baz; quux } > :baz > => nil > > martin