[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

callstack level

sean_n

7/5/2006 6:44:00 AM

how do we obtain the callstack level? for you tcl programmers, i'm
looking for something equivalent to [info level].

3 Answers

Robert Klemme

7/5/2006 7:13:00 AM

0

seannakasone@yahoo.com wrote:
> how do we obtain the callstack level? for you tcl programmers, i'm
> looking for something equivalent to [info level].

Does this help?

09:12:26 [~]: ruby -e 'def f() p caller end; p caller; f'
[]
["-e:1"]

Kind regards

robert

sean_n

7/6/2006 6:07:00 PM

0


Robert Klemme wrote:
> seannakasone@yahoo.com wrote:
> > how do we obtain the callstack level? for you tcl programmers, i'm
> > looking for something equivalent to [info level].
>
> Does this help?
>
> 09:12:26 [~]: ruby -e 'def f() p caller end; p caller; f'
> []
> ["-e:1"]
>
> Kind regards
>
> robert

Yes, that helps, thanks. finding the caller was the main reason for
obtaining the callstack level. although knowing how deep the callstack
would also be nice but if i only can find caller, i'm happy.

Robert Klemme

7/6/2006 8:24:00 PM

0

seannakasone@yahoo.com wrote:
> Robert Klemme wrote:
>> seannakasone@yahoo.com wrote:
>>> how do we obtain the callstack level? for you tcl programmers, i'm
>>> looking for something equivalent to [info level].
>> Does this help?
>>
>> 09:12:26 [~]: ruby -e 'def f() p caller end; p caller; f'
>> []
>> ["-e:1"]
>>
>> Kind regards
>>
>> robert
>
> Yes, that helps, thanks. finding the caller was the main reason for
> obtaining the callstack level. although knowing how deep the callstack
> would also be nice but if i only can find caller, i'm happy.
>

caller returns the complete stack.

robert