From: Wilson Bilkovich Date: 2010-06-06T08:18:15+09:00 Subject: Re: comparing objects On Sat, Jun 5, 2010 at 4:09 PM, Robert Dober wrote: > I must have made a stupid mistake in my example code, however, this is > no reason to mess with #eql? and #hash, Be warned. > In that case I stick with Robert's advice: Do not use Array#&, even > MPing Array with something like #intersect_by would be preferable. Implementing this behavior with your own object types is the whole point of the Ruby core API. I find myself struggling to understand the mindset that would prefer re-opening Array and adding something over using the already-there-for-a-reason Enumerable and Array interfaces. Using eql? and hash is not 'messing with' them, unless you don't take the time to understand your tools.