[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: with and without Song#to_s again

Li Chen

12/30/2006 5:54:00 PM


--- Phrogz <gavin@refinery.com> wrote:

you can find this answer yourself.
> 1) Open a console and type:
> ri Kernel.puts
>
> 2) See that it says that it's the same as
> $stdout.puts. Type:
> ri IO.puts
>
> 3) See that it says that it does the same thing as
> print does. Type:
> ri IO.print
>
> 4) See that it tells you that it calls the to_s
> method of any objects
> that aren't strings.


Thank you for the detail explanation. Now I understand
why #to_s is called.

Li

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail...