Programming Language Theory: Difference between revisions
| Line 139: | Line 139: | ||
** Parametric polymorphism: Generation of a version for necessary types (Ada generics, C++ templates, SML type parameters) | ** Parametric polymorphism: Generation of a version for necessary types (Ada generics, C++ templates, SML type parameters) | ||
* Support for ''subtyping'', refining T as T<sub>0</sub> (defining an ordering relation on types: T ''subsumes'' T<sub>0</sub>, x ∈ T<sub>0</sub> ⇒ x ∈ T) | * Support for ''subtyping'', refining T as T<sub>0</sub> (defining an ordering relation on types: T ''subsumes'' T<sub>0</sub>, x ∈ T<sub>0</sub> ⇒ x ∈ T) | ||
** ''Subclassing'' (inheritance) is independent of subtyping | ** '''NB''': ''Subclassing'' (inheritance) is independent of subtyping! | ||
** Subsumption properties can't be arbitrarily enforced (decided) when subclasses override the implementation | |||
** ''Soundness'' refers to data structuring operation support for subtyping, such as annotation of type alterations: | |||
*** '''Covariant''' modifications retain the original ordering | |||
*** '''Contravariant''' modifications invert the original ordering | |||
*** '''Invariant''' modifications dissolve the subsumption relation | |||
* Support for ''minimal'' and ''maximal'' types (also known as Bottom and Top) | * Support for ''minimal'' and ''maximal'' types (also known as Bottom and Top) | ||
===Conversion=== | ===Conversion=== | ||