Contents | Prev | Next

5.10 Set types

Description

Set types define values which are combinations of optional values of the same ordinal type (called the set's base type). In any combination of values, the same value can not appear more than once. All set type values include the empty set (i.e. the combination where none of the optional values are present).

For example the following set type

   set of boolean

defines four values

  1. [] - the empty set
  2. [false] - the combination containing false but not true
  3. [true] - the combination containing true but not false
  4. [false, true] - the combination containing both false and true

Example

Here are some examples of set types

   set of char
   set of boolean

Syntax

The syntax for defining new set types is given below:

(NOTE: for clarity some parts of the syntax are omitted, see Irie Pascal Grammar for the full syntax):

   set-type = 'set' 'of' base-type

   base-type = ordinal-type

   new-ordinal-type = enumerated-type | subrange-type

   ordinal-type = new-ordinal-type | ordinal-type-identifier

   ordinal-type-identifier = identifier

Contents | Prev | Next