From: "Christoph R." Date: 2003-09-14T11:02:06+09:00 Subject: Re: Ruby Object Model bothering me Kurt M. Dresner wrote: > Ok, so I did > > a = Array.new(number, []) > > It's really bothering me that if I do a[i] = n, all of a is now n. > > Is there a graceful way to get around this? I guess you want --- a = Array.new(6){[]} a[3][1] = 8 p a[3] # [nil,8] p a[4] # [] --- /Christoph