From: "Marcel Molina Jr." Date: 2005-06-26T01:25:52+09:00 Subject: Re: Hash hidden in hash with default object On Sun, Jun 26, 2005 at 12:53:59AM +0900, Marcel Molina Jr. wrote: > I observed this odd behavior when setting a hash to have as its default > value another hash which itself has a default value set: > > >> hash_in_hash = Hash.new(Hash.new([])) > => {} > >> hash_in_hash[:a][:b] << :incognito > => [:incognito] > >> hash_in_hash > => {} > >> hash_in_hash[:a] > => {} > >> hash_in_hash.keys > => [] > >> hash_in_hash[:a][:b] > => [:incognito] > >> hash_in_hash[:a].keys > => [] Responding to myself... To achieve the desired result in this case I should be using the block form. Thanks for taking a look. I'll figure this out... marcel -- Marcel Molina Jr.