| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
Beckman Access Type B, Beckman Coulter Access Chemistry Analyzer, Type B... blockscientific.com | The autonomic nervous system (ANS) or visceral nervous system - DeMoss demosschiropractic.com | SMA Clinical Research Center about Type 1, Type 2, Type 3 columbiasma.org | diabetes, type 2 diabetes, type 1 diabetes, diabetes diets information tbfinc.com |
In computer science a nominal or nominative type system (or name-based type system) is a major class of type system, in which compatibility and equivalence of data types is determined by explicit declarations and/or the name of the types. Nominative systems are used to determine if types are equivalent, as well as if a type is a subtype of another. It contrasts with structural systems, where comparisons are based on the structure of the types in question and do not require explicit declarations.
[edit] Nominal typingNominal typing means that two variables are type-compatible if and only if their declarations name the same type. For example, in C, two However, C also allows a [edit] Nominal subtypingIn a similar fashion, nominal subtyping means that one type is a subtype of another if and only if it is explicitly declared to be so in its definition. Nominally-typed languages typically enforce the requirement that declared subtypes be structurally compatible (though Eiffel allows non-compatible subtypes to be declared). However, subtypes which are structurally compatible "by accident", but not declared as subtypes, are not considered to be subtypes. C, C++, C# and Java all primarily use both nominal typing and nominal subtyping. C and C++ permit limited structural subtyping for anonymous types (two anonymous types are considered equivalent if they have the same structure, even if the types are "described" in different parts of the code). Some nominally-subtyped languages, such as Java and C#, allow classes to be declared final (or sealed in C# terminology), indicating that no further subtyping is permitted. [edit] ComparisonNominal typing is useful at preventing accidental type equivalence, and is considered to have better type-safety than structural typing. The cost is a reduced flexibility, as, for example, nominal typing does not allow new super-types to be created without modification of the existing subtypes. [edit] See also[edit] References
[edit] External links |
| ↑ top of page ↑ | about thumbshots |