From: Glenn Jackman Date: 2010-04-23T22:35:05+09:00 Subject: Re: What is wrong with this few lines of code At 2010-04-23 08:49AM, "Damjan Rems" wrote: > > ar = Array.new( 2,[]) ar[0] and ar[1] both refer to the same (empty) array at this point ar = Array.new(2, []) # => [[], []] ar[0].object_id # => 136474520 ar[1].object_id # => 136474520 You want the block syntax for Array.new ar = Array.new(2) {[]} # => [[], []] ar[0].object_id # => 136514378 ar[1].object_id # => 136514364 -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous