From: Jean-Hugues ROBERT Date: 2004-04-08T05:15:00+09:00 Subject: IdentityHash, like Hash but with keys using equals? vs eql? Hi, I just encountered a rare case where I need a Hash where keys are object id. Class Hash compares keys by value. As a result two different String with the same value are considered the same key. This is fine in most cases. But right now I need to be more restrictive and I need two String objects to be treated as two keys even if they have the same value. I think IdentityHash is a probable name for such a beast, yet I could not find one in Ruby and I don't see any method in class Hash that I could redefine in a derived class to change the way keys are compared. BTW: IdentityHash should be slightly faster than Hash. Any clue ? Thanks, Jean-Hugues Robert