[#1551] Hashes as keys — "Nathaniel Talbott" <nathaniel@...>

I was just playing around with Hash#hash and discovered that you can't use a

13 messages 2003/09/23

Re: ostruct.rb patch

From: matz@... (Yukihiro Matsumoto)
Date: 2003-09-24 15:51:15 UTC
List: ruby-core #1567
Hi,

In message "Re: ostruct.rb patch"
    on 03/09/24, "Nathaniel Talbott" <nathaniel@talbott.ws> writes:

|> You define == and hash, not eql? and hash, right?
|> What is the purpose of redefining #hash?
|
|Oops! I forgot that #eql?, not #==, is the #hash counterpart (there's
|entirely too much Java in my past). I'll drop the redefinition of #hash.

Show me the latest diff.  I think I will agree to apply it.

|I hadn't thought of that. Do you think a protected method is better? I'm
|assuming it's probably faster.

I didn't measure statistic, but at least this is a purpose of Ruby's
protected method designed.

							matz.

In This Thread