blog of sness
class ArrayMD < Array def [](n) self[n]=ArrayMD.new if super(n)==nil super(n) end end a = ArrayMD.new a[1][2][3]="foo" #=> [nil, [nil, nil, [nil, nil, nil, "foo"]]]