From: matt@... (matt neuburg) Date: 2009-02-25T01:24:22+09:00 Subject: better error reporting from eval? This might seem silly, but it is only a reduced version of a real issue. Consider the following: class Thing def ev(what) eval(what) end def bar() 1 + 1 nil + 2 # causing an exception in bar() end def foo bar() end end Thing.new.ev("foo()") NoMethodError: undefined method `+' for nil:NilClass method ev in untitled at line 4 method foo in untitled at line 11 method ev in untitled document at line 1 method eval in untitled at line 15 method ev in untitled at line 4 at top level in untitled at line 15 Notice that the error report makes no mention of bar(). This can make exceptions in an eval difficult to track down. Is there a way to get better error reporting in an eval? Thx - m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Leopard - http://www.takecontrolbooks.com/leopard-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com