[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

print out a variable's name and value?

Ferenc Engard

9/11/2003 9:53:00 PM

Hello,

I want a comfortable debug function to which I can pass a variable, and
it writes out the variable's name and value. Can I accomplish this?

If I could manipulate the calling stack as bindings, and could get the
binding of the caller, then I could pass the variable's name (e.g. as
debug(:x)), and make it's name and value printed.

If I have to write debug(:x,binding()), then instead I write
debug(:x,x). :-)) And I will be sad that I cannot use CPP on ruby
source. :)

Circum

PS: As you can see, it is rather a theorethical problem... :-)