From: Joel VanderWerf Date: 2005-08-29T13:49:58+09:00 Subject: Re: Hash.new(confusion) Trans wrote: > irb(main):006:0> def r > irb(main):007:1> @r ||= Hash.new({}) > irb(main):008:1> end > => nil > irb(main):009:0> r[:a] > => {} > irb(main):010:0> r[:b][:c] = 10 > => 10 > irb(main):011:0> r > => {} > irb(main):012:0> r[:b] > => {:c=>10} > irb(main):013:0> > > Please explain how r is empty but r[:b] exists. Thank You. > > T. > Try p r.default and you'll see what's going on. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407