From: nobu.nokada@... Date: 2002-01-25T10:22:59+09:00 Subject: Re: Serious Array Bug in Ruby 1.6.6? Hi, At Fri, 25 Jan 2002 03:55:26 +0900, Dave Thomas wrote: > > |Hmmm, I'll suggest to change Array.new to take a block when > > |no default value given. That is: > > | > > | a = Array.new(2) {|i| Hash.new} # i is 0, 1... > > > > Instead, how about Array#fetch to take block for the default value? > > (I already did in my local copy.) > > Why not make the Array constructor consistent with Hash? The semantic > seems the same. > > Array.new {|aref,i| ...} > > then calling > > a[99] > > would invoke the block, passing in the array and '99'. Whenever the > block returned would be the value in the array. Isn't this the way > Hash.new works? I thought it too, but the problem is struct RArray has no more space to keep the block. Add to aux? -- Nobu Nakada