From: Daniel Waite Date: 2006-10-13T09:28:22+09:00 Subject: Re: Hash & keys... S辿bastien Wautelet wrote: > I'd have expected h[v2] => "whatever is in (4,5)", since v==v2 and both > have the same hash value... what am I doing wrong? Hash keys can be any object. So your hash, h, has one key, the object v. Take another hash real quick, we'll call it hash. hash = Hash.new hash['rabbit'] = 'cute' # 'cute' hash['blue'] # nil The value for any hash key not defined is nil (unless you explicitly tell the hash during instantiation to use another value). So just because you're using the value of v as a key in your hash, does not mean that v2 is automatically another key in your hash. -- Posted via http://www.ruby-forum.com/.