Standard modes
Many of the modes available in the standard prelude are built from the
standard modes of the language which are all defined in the Revised
Report.
- VOID
- This mode has one value:
EMPTY
. It is mainly used as the yield
of routines and in unions.
- BOOL
- This mode has two values, namely TRUE and
FALSE.
INT
- This is the basic arithmetic mode. Various precisions are available:-
- LONG INT 64-bit integer
- INT 32-bit integer
- SHORT INT 16-bit
integer
- SHORT SHORT INT 8-bit integer
REAL
- This mode is used mainly for approximate calculations although
exact values can be manipulated provided that the number of
significant digits does not exceed the precision of the mantissa (see
section 13.2.1). The
following precisions are available:-
- REAL 64-bit real
- SHORT REAL 32-bit real
COMPL
- Strictly speaking, this is not a fundamental mode because it is
regarded as a structure with two fields:-
MODE COMPL = STRUCT(REAL re,im)
However, the widening coercion will convert a REAL
value into a
COMPL
value and COMPL
values are not straightened (see
section 13.7.6). Like
REAL
s, the following precisions are available:-
- COMPL 128-bit
- SHORT COMPL 64-bit
- CHAR
- This mode is used for most character operations. See section
13.2.2 for further details.
BITS
- This mode is equivalent to a computer word regarded as a group of
bits (binary digits) numbered 1 to
bits width
(see
section 13.2.1). Various
precisions are available:-
- LONG BITS 64-bit
- BITS 32-bit
- SHORT BITS 16-bit
- SHORT SHORT BITS 8-bit
- BYTES
- The Revised Report describes the mode, but the a68toc compiler does not
implement it.
- STRING
- This mode is defined as
MODE STRING = FLEX[1:0]CHAR
and is provided with a shorthand construct for denotations of such
values (see section 3.1).
Sian Mountbatten
2012-01-19