[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: What is wrong in this code ... ???

Devin Mullins

7/5/2005 8:05:00 PM

> p st.inspect is short for print st.inspect, which sends the string to STDOUT.
Not quite.

print "blah" prints blah to stdout
print "blah","bloo" prints blahbloo to stdout

puts "blah" is short for print "blah", "\n"

p st is short for puts st.inspect

These are all documented in the Kernel module:
http://www.ruby-doc.org/core/classes/K...

Well, except for the #inspect method, which is documented in the Object class, as well as, probably, other places that override its behavior.
http://www.ruby-doc.org/core/classes/O...

Granted, that's not the best way to learn the language. 'Programming Ruby' is a much better way, or why's (Poignant) Guide to Ruby.
http://phrogz.net/Progra...
http://poignantguide...

HTH,
Devin