From: Paul Brannan Date: 2002-03-15T05:33:47+09:00 Subject: Re: Some potential RCRs [Comments Summarized] On Fri, Mar 15, 2002 at 05:09:47AM +0900, Dave Thomas wrote: > Matt Armstrong writes: > > > > A "println" method. (println "hello", " ", "there" ==> print > > > "hello", " ", "there", "\n") > > > > I assume this is different from puts in that it always prints an extra > > newline, even if the printed value already ends in one? E.g. > > And also that > > println "a", "b" > > would write "ab\n" while > > puts "a", "b" > > writes "a\nb\n" I would also guess that: def println(*x); x.each { |y| print y }; print "\n"; end class Foo < Array def to_s; return inspect; end end println Foo[1, 2, 3] # prints "[1, 2, 3]\n" puts Foo[1, 2, 3] # prints "1\n2\n3\n" Though I don't think I've seen anyone particularly attached to puts's behavior here (see [ruby-talk:28052] and following). Paul