Seeing the wonderfulness of the 'to_ruby' method I mentioned just
recently got me thinking about Object#caller and Exception#backtrace again.
I don't know about anybody else, but it seems strange to me that these
potentially really useful methods return an array of fixed strings. I'm
also puzzled by what information it is they return, and what they don't:
They return the filename and a line number, which is great. A method,
which is useful... but no class / module or other form of nesting? Does
anybody understand why that is? Is there any desire to fix it? I think
having the class/module, at least, would be hella-useful.
For my own sake, I've created a little bit of ruby code that defines a
couple of methods for Object (caller_as_arrays and caller_as_objects)
and for Exception (backtrace_as_arrays and backtrace_as_objects).
caller_as_arrays and backtrace_as_arrays return something like: