List Info

Thread: Re: Understanding the output of Kernel#caller




Re: Understanding the output of Kernel#caller
user name
2008-07-01 13:44:43
On 6/19/08, Wilson Bilkovich <wilsonbgmail.com> wrote:
> I am trying to understand what Ruby 1.8 outputs when
"caller" is invoked.
>  I am working on making Rubinius produce compatible
results, but there
>  are some scenarios I have not been able to understand.
 The one
>  outlined below looks like a Ruby bug to me.
>
>  Can someone confirm or deny that for me?
>
>  Here is a test script that shows a medium-complexity
call to 'caller':
> ...

Unless there is an objection, I will file this on the bug
tracker.

Regards,
--Wilson.


Re: Understanding the output of Kernel#caller
user name
2008-07-02 16:00:44
This manifests itself in rescues as well:

def caller_in_eval
  eval(";raise 'w00t&#39;")
end

def method_with_block
&nbsp; begin
&nbsp; &nbsp; yield
&nbsp; rescue
&nbsp; &nbsp; p "method_with_block"
  end
end

method_with_block do
  begin
&nbsp; &nbsp; caller_in_eval
  rescue
&nbsp; &nbsp; p "calling m_w_b";
  end
end

You would expect to see "method_with_block" but instead get "calling m_w_b";

-- Yehuda

On Tue, Jul 1, 2008 at 11:44 AM, Wilson Bilkovich < wilsonbgmail.com">wilsonbgmail.com> wrote:
On 6/19/08, Wilson Bilkovich < wilsonbgmail.com">wilsonbgmail.com> wrote:
&gt; I am trying to understand what Ruby 1.8 outputs when "caller" is invoked.
>  I am working on making Rubinius produce compatible results, but there
&gt;  are some scenarios I have not been able to understand.  The one
>  outlined below looks like a Ruby bug to me.
>
>  Can someone confirm or deny that for me?
>
>  Here is a test script that shows a medium-complexity call to 'caller':
> ...

Unless there is an objection, I will file this on the bug tracker.

Regards,
--Wilson.




--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )