Re: Comparing DS_HASH_TABLE objects

Helmut Brandl <[email protected]> Thu, 04 Jun 2009 09:59:52 -0500
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Peter Gummer wrote:
> Paul Cohen wrote:
>>> So regardless whether an entity is reference or expanded, feature calls
>>> are done in the same manner. If it comes to equality testing, we have to
>>> use different operators to test for equality (surely you can write 200 ~
>>> 200 instead of 200 = 200, but it reads ugly).
>>>     
>> I agree. Maybe "==". would look nicer.
>>   
> 
> I think Helmut was wishing that '=' between reference types had been 
> used for object equality, as it is between expanded types.

Exactly. I would like to have to most natural operator to express object
equality. And that is "=". I guess in the majority of the cases the user
wants to test object equality and not reference equality.

But this is a theoretical wish. Nobody will accept such a discussion.
The argument with backward compatibility kills everything in that direction.

> 
> I've often wished the same thing. It would have been more intuitive. The 
> '=' operator would have consistently been used to express the idea that 
> two objects have the same value. Then some other operator would have 
> been needed for reference equality: maybe '~'. (Your  '==' suggestion 
> might have been a good choice, Paul, from a marketing perspective in 
> this C-dominated world.)

But why have different operators of object equality and reference
equality in the first place? Why not

  a  =  b     -- test for object equality
  $a = $b     -- test for address equality (i.e. reference equality)

since we have already the address operator in Eiffel?

Regards
Helmut


------------------------------------

To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected]! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/gobo-eiffel/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/