Re: domains aren't subtypes, right?

From: Marshall Spight <mspight_at_dnai.com>
Date: Fri, 23 May 2003 15:57:05 GMT
Message-ID: <lxrza.85998$rt6.30283_at_sccrnsc02>


"Alfredo Novoa" <alfredo_at_ncs.es> wrote in message news:e4330f45.0305230343.b8ca8bd_at_posting.google.com...
> "Marshall Spight" <mspight_at_dnai.com> wrote in message news:<DGhza.951082$F1.115813@sccrnsc04>...
>
> > So what is the relationship of the city type to the string type? It's
> > not a subtype.
>
> It is. I don't see any problem. We simply must decide which operators
> we want to inherit.

I don't see how we can decide that a given subtype won't inherit some operator and still have substitutability. It seems to me that substitutability has to work to call something a subtype.

City paris = ...
String s;

s = paris || "foo"   -- should fail at compile time if concat not defined for city
s = paris              -- should succeed if City is subtype of String
s = s || "foo"       -- what should this do?

The closest I can come to making something work is having City have a string delegate. Then they aren't assignment compatible anymore, but maybe that's okay. The question of not inheriting operators is also solved.

Marshall Received on Fri May 23 2003 - 17:57:05 CEST

Original text of this message