A
Aldric Giacomoni
irb(main):086:0> a = Hash.new(Hash.new)
=> {}
irb(main):087:0> a[5]
=> {}
irb(main):088:0> a[5][4] = 3
=> 3
irb(main):089:0> a
=> {}
irb(main):090:0> a[5]
=> {4=>3}
irb(main):091:0> a[5][4]
=> 3
irb(main):092:0> RUBY_DESCRIPTION
=> "ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]"
Upon inspection of 'a', it sure seems that it's empty, but upon
inspection of the key, it does have a value attached to it! Can we trust
this? Expected / unexpected behavior ?
=> {}
irb(main):087:0> a[5]
=> {}
irb(main):088:0> a[5][4] = 3
=> 3
irb(main):089:0> a
=> {}
irb(main):090:0> a[5]
=> {4=>3}
irb(main):091:0> a[5][4]
=> 3
irb(main):092:0> RUBY_DESCRIPTION
=> "ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]"
Upon inspection of 'a', it sure seems that it's empty, but upon
inspection of the key, it does have a value attached to it! Can we trust
this? Expected / unexpected behavior ?