Re: domains aren't subtypes, right?
Date: 26 May 2003 05:02:06 -0700
Message-ID: <e4330f45.0305260402.1331c9fa_at_posting.google.com>
"Marshall Spight" <mspight_at_dnai.com> wrote in message news:<lxrza.85998$rt6.30283_at_sccrnsc02>...
> 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.
See my response to Bob. I was confused.
> City paris = ...
> String s;
> s = paris || "foo" -- should fail at compile time if concat not defined for
But concat is always defined for strings.
> s = paris -- should succeed if City is subtype of String
> s = s || "foo" -- what should this do?
It will work, but the value in s will not be a city with a high probablity.
> 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.
If city stands for city name a string subtype (string type included) is OK for me.
Regards
Alfredo
Received on Mon May 26 2003 - 14:02:06 CEST