From: Florian Gross Date: 2006-06-07T19:36:43+09:00 Subject: Re: [Bug?] set_trace_func: binding has wrong self value for return events Yukihiro Matsumoto wrote: > It is a bug, and expected output should be > > ["return", "/tmp/t.rb", 3, :initialize, #, Test] > [:unexpected, Test] > :unexpected > > because the scope of the binding should be the one for Test#initialize. Ah, hm. Any chance of having binding(n) where n=0 is the current binding and n=1 is the caller's binding in standard Ruby then? Or do you feel it is too much of a risk because it can be abused? What it would be highly useful for is debugging. I think I might be able to implement Binding.of_caller even when the bug that currently allows it to work is fixed, but it won't be pretty. Thanks again for all your help! -- http://flgr.0x42.net/