Definition of A "type"
(Parnas, Shore & Weiss 1976) identified five definitions of a "type" that were used—sometimes implicitly—in the literature:
- Syntactic
- A type is a purely syntactic label associated with a variable when it is declared. Such definitions of "type" do not give any semantic meaning to types.
- Representation
- A type is defined in terms of its composition of more primitive types—often machine types.
- Representation and behaviour
- A type is defined as its representation and a set of operators manipulating these representations.
- Value space
- A type is a set of possible values which a variable can posses. Such definitions make it possible to speak about (disjoint) unions or Cartesian products of types.
- Value space and behaviour
- A type is a set of values which a variable can posses and a set of functions that one can apply to these values.
The definition in terms of a representation was often done in imperative languages such as ALGOL and Pascal, while the definition in terms of a value space and behaviour was used in higher-level languages such as Simula and CLU.
Read more about this topic: Data Type
Famous quotes containing the words definition of, definition and/or type:
“No man, not even a doctor, ever gives any other definition of what a nurse should be than thisdevoted and obedient. This definition would do just as well for a porter. It might even do for a horse. It would not do for a policeman.”
—Florence Nightingale (18201910)
“It is very hard to give a just definition of love. The most we can say of it is this: that in the soul, it is a desire to rule; in the spirit, it is a sympathy; and in the body, it is but a hidden and subtle desire to possessafter many mysterieswhat one loves.”
—François, Duc De La Rochefoucauld (16131680)
“Lise: Look, monsieur, I dont know what type of girl you think I am, but Im not. And now I would like to return to my friends.
Jerry: I thought you were bored with them. You sure looked it.
Lise: You should see me now.
Jerry: Ouch.”
—Alan Jay Lerner (19181986)