Environment Enquiry

Meaning

An environment enquiry is a kind of procedure defined in the standard prelude whose purpose is to provide information about the properties of the particular implementation used to compile the program.

Procedures implementing environment enquiries do not take any argument and yield a value of some appropriate mode. For example, the max int environment enquiry yields a value of mode int, whereas null character yields a value of mode char.

The section 10.2.1 of the Revised Report defines the environment enquiries that a conforming implementation must provide. These are:

int int lenghts

1 plus the number of extra lenghts of integers. This determines how many long entries in a longsety preceding int are meaningful in the implementation.

int int shorts

1 plus the number of extra shorts of integers. This determines how many short entries in a shorsety preceding int are meaningful in the implementation.

sizety int sizety max int

The largest sizety integral value.

int real lengths

1 plus the number of extra lenghts of real numbers. This determines how many long entries in a longsety preceding real are meaningful in the implementation.

int real shorts

1 plus the number of extra shorts of real numbers. This determines how many short entries preceding real in a shortsety are meaningful in the implementation.

sizety real sizety max real

The largest sizety real value.

sizety real sizety small real

The smallest sizety real value such that both sizety 1 + sizety small real > sizety 1 and sizety 1 - sizety small real < sizety 1.

int bit lengths

1 plus the number of extra longs of bits. This determines how many long entries in a longsety preceding bits are meaningful in the implementation.

bin bit shorts

1 plus the number of extra shorts of bits. This determines how many short entries in a shortsety preceding bits are meaningful in the implementation.

int sizety bits width

The number of elements in a value of mode sizety bits.

int bytes lenghts

1 plus the number of extra longs of bytes. This determines how many long entries in a longsety preceding bytes are meaningful in the implementation.

int bytes shorts

1 plus the number of extra shorts of bytes. This determines how many short entries in a shortsety preceding bytes are meaningful in the implementation.

int sizety bytes width

The number of elements in a value of mode sizety bytes.

op abs = (char a) int

The integral equivalent of the character a.

op repr = (int a) char

That character x, if it exists, for hich abs x = a.

int max abs char

The largest integral equivalent of a character.

char null character

Some character.

char flip

The character used to represent true during transput.

char flop

The character used to represent false during transput.

char errorchar

The character used to represent unconvertible arithmetic values.

char blank

The blank character.

See Also