Alex Young wrote:
> Ron Green wrote:
>>> pigeonhole principle 
>> If Its not guaranteed to be unique, then it can't be used for identity.
>> Can you give me an example of how i would use string.hash?
> In general, you wouldn't use String#hash, although you might conceivably
> want to override it.  It's there for Hash.  From the documentation on
> Object#hash:
> 
> "Generates a Fixnum hash value for this object.  This function must have
> the property that a.eql?(b) implies a.hash == b.hash.  The hash value is
> used by class Hash."
> 
> Note the direction of implication: a == b => a.hash == b.hash, not
> a.hash == b.hash => a == b.

I think I understand. In other words it's not something I would use 
directly. I just ran across it in Peter's book and wanted to make sure I 
understood. Thanks everybody. Sorry if my ignorance pissed you off 
Philip.
-- 
Posted via http://www.ruby-forum.com/.