equality

veldhvz veldhvz@ipo.tue.nl
Fri, 04 Jul 1997 10:19:39 +0200


On my question
>A question: "Is it possible to implement in Clean
>an operator that checks for token-identity?"

Hamilton Richards Jr. wrote:
>The question calls for making an explicit distinction between two kinds of
>equality-- extensional equality (often called "equivalence") and
>intensional equality (often called "identity"). Obviously identity implies
> ...

Where I replied:
>Thank you for pointing this out to me. I was aware that something
>like this might be the case, but I didn't see exactly what was 
>the problem
> ...
> Why isn't there a restriction defined on the instances of the
> == operator so that x==x  must always yield True?
> This restriction would allow the compiler to make the suggested
> optimization.

Or rather, why isn't there a predefined equality operator
on all types, that merely checks whether the normal forms
of its arguments are structurally the same.
This operator could easily be implemented in a way that
exploits token-identity.

-- 
Gert Veldhuijzen van Zanten
---------------------------------------------------
IPO, Center for Research on User-System Interaction
phone: +31 40 2475260,          fax: +31 40 2431930             
URL: http://www.tue.nl/ipo/people/veldhvz
e-mail: veldhvz@ipo.tue.nl  
P.O. Box 513, 5600 MB  Eindhoven, the Netherlands     
---------------------------------------------------