next up previous contents index
Next: Value typecasts Up: Expressions Previous: Function calls

Set constructors

When you want to enter a set-type constant in an expression, you must give a set constructor. In essence this is the same thing as when you define a set type, only you have no identifier to identify the set with.

A set constructor is a comma separated list of expressions, enclosed in square brackets.


Set constructors

syntdiag2800

syntdiag2804

All set groups and set elements must be of the same ordinal type.

The empty set is denoted by [], and it can be assigned to any type of set. A set group with a range [A..Z] makes all values in the range a set element. If the first range specifier has a bigger ordinal value than the second the set is empty, e.g., [Z..A] denotes an empty set.

The following are valid set constructors:


listing2779


next up previous contents index
Next: Value typecasts Up: Expressions Previous: Function calls

Michael Van Canneyt
Fri Sep 25 09:15:40 MEST 1998