From: ts Date: 2001-12-11T01:02:59+09:00 Subject: [ruby-talk:28094] Re: How does puts decide how to print a given object? >>>>> "H" == Harry Ohlsen writes: H> alias old_puts puts Apparently you like alias and self :-) Try this def puts(x) if x.type == Array x.puts else super end end class Array def puts Kernel::puts self end end a = [1, 2, 3, 4, 5] puts a # => "1\n2\n3\n4\n5" (ie, the normal output) class Array def puts super to_s end def to_s "[" + join(", ") + "]" end end b = [1, 2, 3, 4, 5] puts b # => "[1, 2, 3, 4, 5]" Guy Decoux