Formal Parameter

Meaning

A formal parameter is the left hand side of an identity declaration, and consists of a formal declarer, which indicates the mode of the internal object being ascribed in the identity declaration, followed by a defining identifier to which the value will be ascribed. In the identity declaration:

real ratio = 2.71828;

The formal parameter is real ratio, the formal declarer is the mode indication real and the defining identifier is ratio.

Formal parameters also appear in routine texts, where they define which values are accepted as parameters by the routine when it is called. This highlights that in Algol 68 the mechanism of associating formal parameters with actual parameters is the identity declaration: during a function call the internal values provided in the call get ascribed to the formal parameters. For example, in the following routine:

proc multiply vectors = (vector a, vector b) vector:
begin
  ...
end

The formal parameters are vector a and vector b.

Note that formal parameters may appear “distributed” in the case of contracted definitions. In the following example:

real x, y, z;

There are three formal parameters, which are real x, real y and real z.

Syntax

Simplified [RR 4.4.1.a:c]

A) MODINE :: MODE ; routine.

a) MODINE identity declaration of DECS:
     formal MODINE declarer, identity joined definition of DECS.

b) routine declarer: procedure token.

c) identity definition of MODE TAG:
     MODE defining identifier with TAG, is defined as token, MODE source for MODINE.

Note that is defined as token is the equal sign character in the standard representation.

See Also