Re: The naive test for equality

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 1 Aug 2005 22:21:14 -0700
Message-ID: <1122960074.359597.49310_at_g14g2000cwa.googlegroups.com>


I have to say I just don't understand why equality produces so much ink. It's not that complicated a concept: two values are equal if they are the same value.

I guess what makes it so complicated is that we're used to having to work with objects and memory locations and aliasing and so forth. These are all *implementation* complexities, though; the interface remains blindingly simple.

And as far as implementation goes, it seems to me that a type system constructed a certain way would always be able to write the equals function. It would need to understand the difference between ordered data and unordered data, so that it would be able to know the difference between { 1, 2 } and [ 1, 2 ]. It would then be able to know that { 1, 2 } and { 2, 1 } were the same, and that [ 1, 2 ] and [ 2, 1 ] were different. It would also need not to support stateful encapsulation, but I consider that an advantage. Stateful encapsulation is quite popular in OO languages, but it's the enemy of data management. You can't manage what you can't observe.

I don't really buy in to the idea that there's a difference between the RM engine's type system and the domain type system. (If only because if I have to implement a language, the type system's going to be the hardest part, and I only want to have to do that once!)

Marshall Received on Tue Aug 02 2005 - 07:21:14 CEST

Original text of this message