Manifest typing

Manifest typing
Type systems

Type safety
Inferred vs. Manifest
Dynamic vs. Static
Strong vs. Weak
Nominal vs. Structural
Dependent typing
Duck typing
Latent typing
Linear typing
Uniqueness typing

This box: view · talk · edit

In computer science, manifest typing is when the software programmer explicitly identifies the type of each variable being declared. For example: if variable X is going to store integers then its type must be declared as integer.

In contrast, some programming languages use implicit typing (a.k.a. type inference) where the type is deduced from context or allow for dynamic typing in which the variable is just declared and may be assigned a value of any type at runtime.

Examples

Consider the following example written in the C programming language:

#include <stdio.h>
 
int main(void)
{
    char s[] = "Test String";
    float x  = 0.0;
    int y = 0;
 
    printf("Hello World\n");
    return 0;
}

Note that the variables s, x, and y were declared as a character array, floating point number, and an integer, respectively. The type system rejects, at compile-time, such fallacies as trying to add s and x.

In contrast, in Standard ML, the types are not explicitly declared. Instead, the type is determined by the type of the assigned expression.

let val s = "Test String"
    val x = 0.0
    val y = 0
in print "Hello World\n"
end

There are no manifest types in this program, but the compiler still infers the types string, real and int for them, and would reject the expression s+x as a compile-time error.

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Manifest — has different meanings. It may refer to the following: Arts Manifest (convention), the Melbourne Anime Festival Business Manifest Limited, the UK marketing company Computing Manifest file, a file that contains information about accompanying files …   Wikipedia

  • Latent typing — In computer programming, latent typing (as opposed to eager typing or manifest typing) is a style of typing that does not require (or perhaps even offer) explicit type declarations. Latent typing is heavily associated with duck typing and dynamic …   Wikipedia

  • Duck typing — Type systems Type safety Inferred vs. Manifest Dynamic vs. Static Strong vs. Weak Nominal vs. Structural Dependent typing Duck typing Latent typing Linear typing Uniqueness typing …   Wikipedia

  • Java — Иное название этого понятия  «Ява»; см. также другие значения. Не следует путать с JavaScript. Java Класс языка …   Википедия

  • Type system — Type systems Type safety Inferred vs. Manifest Dynamic vs. Static Strong vs. Weak Nominal vs. Structural Dependent typing Duck typing Latent typing Linear typing Uniqueness typing …   Wikipedia

  • Typewriter — Mechanical desktop typewriters, such as this Underwood Five, were long time standards of government agencies, newsrooms, and offices …   Wikipedia

  • Nominative type system — Type systems Type safety Inferred vs. Manifest Dynamic vs. Static Strong vs. Weak Nominal vs. Structural Dependent typing Duck typing Latent typing Linear typing Uniqueness typing …   Wikipedia

  • C (programming language) — C The C Programming Language[1] (aka K R ) is the seminal book on C …   Wikipedia

  • Dependent type — Type systems Type safety Inferred vs. Manifest Dynamic vs. Static Strong vs. Weak Nominal vs. Structural Dependent typing Duck typing Latent typing Linear typing Uniqueness typing …   Wikipedia

  • international relations — a branch of political science dealing with the relations between nations. [1970 75] * * * Study of the relations of states with each other and with international organizations and certain subnational entities (e.g., bureaucracies and political… …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”