From: Alexandru Popescu Date: 2006-06-27T03:04:19+09:00 Subject: Re: Ruby and Java equality usage Hmmm... for me it is not the name problem, but (hopefully nobody will be agree because I keep repeating it) the fact that I really cannot see a good example for having different implementations for == and eql?. Once I see an example that makes sense, I will consider this discussion closed (from my pov). ./alex -- .w( the_mindstorm )p. --- (http://themindstorms.blogspot.com) On 6/26/06, Elliot Temple wrote: > > On Jun 26, 2006, at 10:20 AM, Robert Klemme wrote: > > > 2006/6/26, Robert Dober : > > > >> Personally I find this situation a bit odd. I'd prefer a single > >> > equivalence relation per class not two. > >> > >> Although I do not feel the same that seems a normal concern, as I > >> pointed > >> out to the OP. > >> Honestly I think it depends on the programming culture we are > >> coming from > >> and when > >> in our mind these are synonyms we are likely to get bitten by that > >> kind of > >> code. > > > > At the moment I'm not so sure whether culture is the background. I > > tend to think that there's a more fundamental issue: having a single > > equivalence relation defined on instances of a class seems to make > > things easier in several areas and I believe that it rather reduces > > programming errors. > > Perhaps the issue is not so much having more than one, but having > unhelpful names for them. We don't get confused by the variety of > each-like methods available. And no one forgets the difference > between times, upto, and downto, despite their similarities. If we > had ==, same_place_in_memory, same_in_hash, and same_object_id (or > whatever they are) people wouldn't get confused even with lots of them. > > -- Elliot Temple > http://www.curi.us/blog/ > > > > >