On Wednesday, 24 September 2003 at 7:16:22 +0900, Jim Freeze wrote: > On Wednesday, 24 September 2003 at 6:21:33 +0900, Nathaniel Talbott wrote: > > I was just playing around with Hash#hash and discovered that you can't use a > > Hash as a key in a hash: > > > > h = {{} => 'a'} > > p h[{}] > > > > => nil > > > > Is this intentional? Since hash overrides #==, I expected it to do the same > > with #hash, but it appears that it just uses Object#hash, which is different > > for every instance. > > > > Thanks, > > I think the id of {} is changing. irb(main):015:0> x = {} => {} irb(main):016:0> h[x] = 4 => 4 irb(main):017:0> h[x] => 4 irb(main):018:0> h[{}] => nil -- Jim Freeze ---------- Workers of the world, arise! You have nothing to lose but your chairs.