Contents | Prev | Next

5.1 What are types?

Types can be defined as groups of values that are related in some way. For example the type integer can be defined as the group of whole number values between -maxint and +maxint. Every constant, variable, parameter, and expression in your program is associated with a specific type.

Irie Pascal defines several built-in types that represent commonly used types. You can use these built-in types or you can define your own. You can even redefine the built-in types, but this is not recommended, because it makes your programs more difficult to understand. Someone reading your program is likely to assume that the built-in types have their normal definition.

Most types must be defined before they can be used, the exceptions to this rule are pointer types, and list types. Pointer and list types are allowed to be used before they are defined to allow self-referencing structures (i.e. structures that point at themselves e.g. linked lists) to be built.

Contents | Prev | Next