From: sto.mar@... Date: 2013-02-02T23:53:46+09:00 Subject: Re: Problem redefining String::to_s Am 02.02.2013 13:06, schrieb Javier 12: > unknown wrote in post #1094871: > >> Well, you should not expect that. >> Why should to_s be sent to an object that already *is* a string??? > > because you're told that puts will call to_s in the object you try to > print, and it's expected that all objects work the same way, that's all The docs tell differently: ri IO.puts Writes the given objects to ios as with IO#print. [...] ri IO.print Writes the given object(s) to ios. The stream must be opened for writing. If the output field separator ($,) is not nil, it will be inserted between each object. If the output record separator ($\) is not nil, it will be appended to the output. If no arguments are given, prints $_. *Objects that aren't strings* will be converted by calling their to_s method. [...] --