From: Benoit Daloze Date: 2012-06-17T03:20:33+09:00 Subject: [ruby-core:45674] Re: [RFC] RubyVM::FrameInfo.caller method Hi, On 2 June 2012 18:47, SASADA Koichi wrote: > Hi, > > (2012/05/29 8:02), Dice wrote: >> I love FrameInfo class! All this time it is that I wanted :-) > > Thank you. �I 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). �At last, we change the class name FrameInfo to Location. > >> � � � * vm_backtrace.c: change names. >> � � � � (1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::Location. >> � � � � (2) Method name: RubyVM::FrameInfo.caller -> >> � � � � � � Kernel.caller_locations. >> � � � � (3) Instance methods of >> � � � � � � � RubyVM::FrameInfo (RubyVM::Backtrace::Location) >> � � � � � � (3-1) name -> label >> � � � � � � (3-2) basename -> base_label (basename is confusing with >> � � � � � � � � � File.basename) >> � � � � � � (3-3) line_no -> lineno (We have already similar name >> � � � � � � � � � File#lineno, commented by kou [ruby-dev:45686]). >> � � � � � � (3-4) filename -> path. >> � � � � � � (3-5) filepath -> absolute_path. >> � � � � � � (3-5) iseq -> removed (we will make other APIs to access iseq >> � � � � � � � � � and other information of frame for debugging). > > 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.