Hi,
On 2 June 2012 18:47, SASADA Koichi <ko1 / atdot.net> wrote:
> Hi,
>
> (2012/05/29 8:02), Dice wrote:
>> I love FrameInfo class! All this time it is that I wanted :-)
>
> Thank you. =A0I doubt that nobody needs such feature until your response.

It is indeed a very interesting feature, parsing caller is very
fragile in nature and not very portable.

Do you intend this to be ported to other implementations? From the
user POV, that would be very valuable.
Is RubyVM::Backtrace::Location appropriate for other impls too?
Or do you think it does not matter what class it is, only it has the
set or a subset of the methods you describe?

> Other guy pointed out that FrameInfo is to noisy (FooInfo is bad naming
> rule). =A0At last, we change the class name FrameInfo to Location.
>
>> =A0 =A0 =A0 * vm_backtrace.c: change names.
>> =A0 =A0 =A0 =A0 (1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::=
Location.
>> =A0 =A0 =A0 =A0 (2) Method name: RubyVM::FrameInfo.caller ->
>> =A0 =A0 =A0 =A0 =A0 =A0 Kernel.caller_locations.
>> =A0 =A0 =A0 =A0 (3) Instance methods of
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 RubyVM::FrameInfo (RubyVM::Backtrace::Locati=
on)
>> =A0 =A0 =A0 =A0 =A0 =A0 (3-1) name -> label
>> =A0 =A0 =A0 =A0 =A0 =A0 (3-2) basename -> base_label (basename is confus=
ing with
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 File.basename)
>> =A0 =A0 =A0 =A0 =A0 =A0 (3-3) line_no -> lineno (We have already similar=
 name
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 File#lineno, commented by kou [ruby-=
dev:45686]).
>> =A0 =A0 =A0 =A0 =A0 =A0 (3-4) filename -> path.
>> =A0 =A0 =A0 =A0 =A0 =A0 (3-5) filepath -> absolute_path.
>> =A0 =A0 =A0 =A0 =A0 =A0 (3-5) iseq -> removed (we will make other APIs t=
o access iseq
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 and other information of frame for d=
ebugging).
>
> What do you think about it?

Sounds good to me.

Just wondering, would it be easy to access the Binding of the nth
caller? That's an evil feature, and it must be lazy or optional for
performance I guess, but it's always fun to play with.