FACTOID # 56: Malaysia has the lowest rate of cinema attendance in the world.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Nominative type system

A nominative type system is a major classes of type system, in which type compatibility and equivalence 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. On computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ...


Nominal typing means that two variables have compatible types only if they appear in either the same declaration or in declarations that use same type name. Note that many languages provide a way of type aliasing; or declaring multiple names of the same type. The C/C++ typedef feature is an example of this capability. C, C++, and Java are all examples of languages which use name type compatibility. typedef is a keyword in the C Programming Language. ... C# redirects here. ... C++ (generally pronounced see plus plus, IPA: ) is a general-purpose computer programming language. ... Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1990s. ...


In 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 it's 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 to be subtypes, are not considered to be subtypes. Eiffel is an object-oriented programming language which emphasizes the production of robust software. ...


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, allow classes to be declared final, indicating that no further subtyping is permitted.


Nominal typing is useful at preventing accidental type equivalence, and is considered to have better type-safety than structual 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.


See also

An abstract type is a type in a nominative type system which is declared by the programmer, and which has the property that it contains no members which are not also members of some declared subtype. ... On computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ...

External links

  • Types and Programming Languages by Benjamin Pierce (MIT Press 2002) [1]
  • c2.com: Nominative and structural typing


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.