From: Fsormok Fsormok Date: 2007-07-23T16:15:22+09:00 Subject: Re: how to make a[2][3]=4 work? > a = Hash.new{|h,k| h[k]=Hash.new &h.default_proc} > irb(main):026:0> require 'ostruct' > irb(main):027:0> int = Hash.new{|h,k| h[k]=OpenStruct.new} >a = {} > ==>{} >a[1] = 1 > ==>1 >a[ [2,1] ] = 2 > ==>2 >a[ [2,2,3] ] = 4 > ==>4 >p a >{[2, 2, 3]=>4, [2, 1]=>2, 1=>1} > ==>nil Tanks for the replies. I'm just a little bit confused because in ruby everything is lean and clean but when it comes to hashes of hashes it gets kind of complicated. For me it looks like ruby has another "concept" of solving such things. -fsormok -- Posted via http://www.ruby-forum.com/.