 |
|
| |
|
 |
 |
at Global Oneness Community.
Share your dreams and let others help you with the interpretation!
Dream Sharing Forum
|
 |
Subtype - Subtyping schemes |  | Subtype - Subtyping schemes: Encyclopedia II - Subtype - Subtyping schemes |  | Type theorists make an important distinction between nominal subtyping, in which only types declared in a certain way may be subtypes of each other, and structural subtyping, in which the structure of two types determines whether or not one is a subtype of the other. The class-based object-oriented subtyping described above is nominal; a structural subtyping rule for an object-oriented language might say that if objects of type A can handle all of the messages that objects of type B can handle (that is, if they de ...
See also:Subtype, Subtype - Subtyping schemes |  | | Subtype, Subtype - Subtyping schemes, A derived type is a type given a new type but structurally the same as the original type. It may or may not be a subtype depending on the type system., Contravariance in Covariance and contravariance (computer science) |  | |
|  |  | Subtype: Encyclopedia II - Subtype - Subtyping schemes
Subtype - Subtyping schemes
Main article: Nominative and structural type systems
Type theorists make an important distinction between nominal subtyping, in which only types declared in a certain way may be subtypes of each other, and structural subtyping, in which the structure of two types determines whether or not one is a subtype of the other. The class-based object-oriented subtyping described above is nominal; a structural subtyping rule for an object-oriented language might say that if objects of type A can handle all of the messages that objects of type B can handle (that is, if they define all the same methods), then A is a subtype of B regardless of whether either inherits from the other. Sound structural subtyping rules for types other than object types are also well known.
Implementations of programming languages with subtyping fall into two general classes: inclusive implementations, in which the representation of any value of type A also represents the same value at type B if A<:B, and coercive implementations, in which a value of type A can be automatically converted into one of type B. The subtyping induced by subclassing in an object-oriented language is usually inclusive; subtyping relations that relate integers and floating-point numbers, which are represented differently, are usually coercive.
In almost all type systems that define a subtyping relation, it is reflexive (meaning A<:A for any type A) and transitive (meaning that if A<:B and B<:C then A<:C). This makes it a preorder on types.
Other related archivesC++, Covariance and contravariance (computer science), Eiffel, Liskov substitution principle, Nominative and structural type systems, computer programs, computer science, datatype, derived type, inherits, methods, object-oriented, polymorphism, preorder, programming language, subclasses, substitutability, type, type theory, typing rule
 Adapted from the Wikipedia article "Subtyping schemes", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |
|
|
More material related to Subtype can be found here:
|
|
« Back
|
Search the Global Oneness web site |
|
|
|
|
 |
Sneak-Peek of Global Oneness Community
Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas
Forum Home,
Articles,
Photo Gallery,
Videos,
News,
Sitemap
...and much more!
|