domains aren't subtypes, right?

From: Marshall Spight <mspight_at_dnai.com>
Date: Fri, 23 May 2003 04:44:20 GMT
Message-ID: <DGhza.951082$F1.115813_at_sccrnsc04>



Hi,

So, I sometimes hear this idea that you could create a new type from an existing type. One example I've heard is that you could declare a "city" type (as part of an address) that was in some way derived from the string type. Then you could decide what operators/functions this new type would "get" (inherit?) from its originating type. For example, you might want to compare city values for equality, or for lexical order, but you wouldn't meaningfully want to concatenate city values, even though city comes from string and string has a concat operator.

Sometimes I hear this called a "domain" but that word seems heavily overloaded.

So what is the relationship of the city type to the string type? It's not a subtype. Could it be a supertype? Some other kind of relationship entirely?

Marshall Received on Fri May 23 2003 - 06:44:20 CEST

Original text of this message