Daniel Martin wrote:
> In addition to what's already been posted, there's this, which doesn't
> require any extra variables or methods:
> 
> a = Hash.new{|h,k| h[k]=Hash.new &h.default_proc}

That's clever, but I think the way it automatically creates keys is 
wrong.  You need to be able to check to see if a key exists without 
polluting the hash with a bunch of empties.

Hence my new gem:

http://github.com/dasil003/safe-nested-hash
-- 
Posted via http://www.ruby-forum.com/.