From: Chad Perrin Date: 2011-12-06T01:28:43+09:00 Subject: black magical hash element vivification Ruby (1.9.3p0 to be precise, installed with RVM) is not behaving as I expected. >> foo = Hash.new( Hash.new ) => {} >> foo[3][2] = true => true >> foo => {} >> foo[3] => {2=>true} >> foo[2] => {2=>true} >> foo => {} >> What I would expect would be something more like this: >> foo = Hash.new( Hash.new ) => {} >> foo[3][2] = true => true >> foo => {3=>{2=>true}} >> foo[3] => {2=>true} >> foo[2] => {} >> foo => {3=>{2=>true}} >> Where and why do my assumptions fail me?