From: Martin DeMello Date: 2003-09-14T15:02:31+09:00 Subject: Re: Ruby Object Model bothering me Kurt M. Dresner wrote: > Yeah, that's what I meant. When I do a[i].push(foo) then all of a is > foo. I forgot about the block for the constructor that gets run each > time. Now I am a happy rubyist once again. Just for completeness, the problem with Array.new(6, []) isn't Ruby's object model - it's that Array.new(num, object) stores a reference to the object passed in in each of its cells, not a copy of it. There's no ruby-decreed reason it couldn't have been written to call object.dup each time it filled a new cell. martin