Submitted by legacy (Mon Jul 30 20:07:14 UTC 2001)
[object_called, method_called_id, args, file_with_call, line_for_call]
'call_stack' takes a level parameter (almost) in the same way as 'caller'. Example:
def m(a,b) puts call_stack.inspect end def m2(a,b) m(a,b) end m2(1,true)
would print
[[main, :m, [1, true], "../call_stack/t2.rb", 5], [main, :m2, [1, true], "../call_stack/t2.rb", 8]]
It might also be useful to add any blocks associated with calls (I'm skeptical if this adds enough value for the added complexity).
Maybe there's a risk in including the args. I'm not sure... Probably there's a risk in any of this since Matz hasn't previously included it?
Comments | Current voting | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
RCRchive copyright © David Alan Black, 2003-2005.
Powered by .
Don't replace, but add.. (Dave, 2001-07-30 19:46:16)
Here's a patch that does some of that... (WayneConrad, 2001-10-19 17:56:40)
Add bindings (, 2002-05-21 02:45:28)
Jean-Hugues
I'd rather do it this way: (matju, 2003-08-04 12:40:29)
(which is partially accepted, but i don't know what of it will go into ruby, and _when_)