From: Chad Perrin Date: 2011-12-06T05:01:15+09:00 Subject: Re: black magical hash element vivification On Tue, Dec 06, 2011 at 01:39:54AM +0900, Adam Prescott wrote: > 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]=. That, for me, is *very* surprising behavior. I would think that it should treat the default as though it exists, even when not referencing it directly.