From: Florian Gross Date: 2004-05-25T08:18:43+09:00 Subject: Re: RCR? change Proc#inspect to show start..end lines Joel VanderWerf wrote: > It would be easier to extract the entire code block without doing > parsing if Proc#inspect returned a _range_ of lines: Heh, are you wanting to do the same that I want to? :) (See http://noegnud.sourceforge.net/flgr/proc_source.rb -- I'm doing lots of manual parsing there however.) > It would also be nice to have reader methods to get this information > from the proc: > > Proc#file > Proc#line_start > Proc#line_finish If we're adding this we might as well think about adding a character index for both the start and the finish which would allow us to find the correct source code even if there are multiple Procs on the same line. (Plus if we had that, we wouldn't need to do any manual parsing at all.) Oh, and it would be great if there was a way to overload eval() without breaking anything. Currently if one does that this won't work any more: a = 5; eval "a" But we might not get a way to do that before the eval:pre-style hooks anyway. Regards, Florian Gross