From: Daniel Sheppard Date: 2007-06-12T15:42:09+09:00 Subject: Re: how to make a[2][2][3]=4 work? > I know this can work,but I think it is suck > a=Hash.new{|h,k| > h[k]=Hash.new{|h,k|h[k]=Hash.new{|h,k|h[k]={}}} > } > > p a[1]=1 > > a[2][1]=2 > a[2][2][3]=4 > a[3][1][1][1]=1 > p a build_hash = proc {|h,k|h[k] = Hash.new &build_hash } a = Hash.new &build_hash