Doing it better 1999-05-28 ### I may have a solution. First, inheritance is not an easy concept unless you are familiar with it, just like sets, and I don't think that can be used in its favour. Second, multiple inheritance has a lot of semantic subtleties which rarely crop up. However, when they do they have to be resolved in a well-defined way, and I think the set representation is as well-defined as I'm going to get. The solution involves defining a function from types to sets of cases, where a case is defined by the following grammar: case ::= Integer | Flot | String | channel | case*case Two sub-types can be distinguished by a typecase statement only if they map to non-overlapping sets of cases. Types which map to the same, singleton case can never be distinguished, and we may therefore cast to the minimal supertype. In particular: (ch x.Integer+String) + (ch y.Float+String) => (ch z.String) If this is not what the programmer requires, he can always tag the cases in some way to make them distinguishable. Details are taking shape... Alistair