Constant Definition

name{, name} = expression


A constant definition instruction permanently binds a particular value to a name in the current name space. When multiple names are defined in one instruction, similar rules are followed as apply to a multiple target assignment.

A constant definition instruction may not be placed inside a loop since, in general, the expression specifying the value may represent a different value each time the definition is reached.

If a name is used before its defining instruction has been reached, its value is Undefined. If it is assigned to, before being defined, the assignment instruction implicitly defines a variable of type Entity. Explicitly defining it after it has been implicitly defined as a variable is treated as a redeclaration error.

It is not an error to use a name defined globally, before redefining it locally. It is recommended, however, to start all global constant names with capital letters and all local constant names with small letters. If this convention is followed, such potential errors will not arise.

Definition instructions are expected to disappear in future versions of Slim.


Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.