From: Jonas Delfs Date: 2002-03-27T23:09:06+09:00 Subject: Hash.new(Hash.new) doesn't use Hash.new as default value Hi - In the documentation for the 'new' method in the Hash class in Programming Ruby it says that 'anObject' will be used as default value, but consider the following example: var = Hash.new(Hash.new) var['index1'] = 'value1' var['index2']['index22'] = 'value22' var['index3']['index32'] = 'value32' var['index4'] = 'value4' p var['donotexist'] Why does "p var['donotexist']" output {"index32" => "value32", "index22" => "value22"} - and _not_ just {} (a new Hash)? If it's no bug, I think it's a bug in documentation. - and not a very logic behavior. -- Mvh./Best Regards Jonas Delfs, http://delfs.dk