From: Adam Prescott Date: 2011-12-06T01:39:54+09:00 Subject: Re: black magical hash element vivification --14dae9340b2bc653aa04b35af794 Content-Type: text/plain; charset=UTF-8 D'oh! Strike that, it's behaving as expected, it's just hidden beneath an extra layer of oddness. >> foo = Hash.new(Hash.new) => {} >> foo[3][2] = true => true There's no assignment for the top-level hash. So the default hash object specified in Hash.new(Hash.new) has been modified, but you can't see it directly because you don't do, e.g., foo[3]=. You just need to poke a hole through, either before or after the fact. Here's after: >> foo[3] = foo["anything"] => {2=>true} >> foo => {3=>{2=>true}} --14dae9340b2bc653aa04b35af794--