From: walter@... Date: 2004-04-16T10:30:52+09:00 Subject: Re: Hash, ==, key-value comparison > Hi, > > In message "Re: Hash, ==, key-value comparison" > on 04/04/16, Elias Athanasopoulos writes: > > |* Change '==' method to compare only key-value pairs. > |* Add Hash#=== method to act like current Hash#== > > They are possible options, along with > > * add new method (e.g. content_equal?) for membership equality. > > I'm not sure which one is the best way to go. > > matz. > I think that most common case for == would be content equals and not content and default value/proc equal. Nobu has a good point that === would make more sense to be a membership test, i.e., alias for Hash#key?. Perhaps eql? would could be content equal and default value/block. This would be similar Numeric where 1 == 1.0 is true but 1.eql?(1.0) is false. Thanks for listening, Walt ***************************************************** Walter Szewelanczyk IS Director M.W. Sewall & CO. email : walter@mwsewall.com 259 Front St. Phone : (207) 442-7994 x 128 Bath, ME 04530 Fax : (207) 443-6284 *****************************************************