Type Constructors
. Array : if T is a type expression then array(I, T) is a type expression denoting the type of an array with elements of type T and index set I
var A: array [1 .. 10] of integer
A has type expression array(1 .. 10, integer)
. Product : if T1 and T2 are type expressions then their Cartesian product T1 x T2 is a type expression
Type constructors are used to construct type expressions from other type expressions. The following are instances of type constructors:
Arrays :
If T is a type expression and I is a range of integers, then array ( I , T ) is the type expression denoting the type of array with elements of type T and index set I. For example, the Pascal declaration,
var A: array[1 .. 10] of integer;
associates the type expression array ( 1..10, integer ) with A.
Products :
If T1 and T2 are type expressions, then their Cartesian product T1 X T2 is also a type expression.
|