From: Paul Brannan Date: 2001-10-15T23:29:22+09:00 Subject: [ruby-talk:22565] Re: Instance method overloading - a bug? On Mon, 15 Oct 2001, Elmar Sonnenschein wrote: > "ts" wrote > > > What do you expect with ? > > > > puts [nil] > > I would expect the same result as for > puts [nil].to_s > (even if to_s is overloaded). I think I would agree here. If a is an array, then `puts a.to_s' seems to be the same as puts `a.join("")', and `puts a' seems to be the same as puts `a.join("\n")'. If I really wanted the latter behavior in the first place, then I would/should have used "join". Another problem with puts (at least under 1.6; I haven't tried 1.7) is that `puts "foo\n"' and `puts "foo"' both do the same thing (print foo followed by a carriage return). This behavior was for me unexpected and inconvenient. Paul