Up | Next | Tail |
Each procedure has a heading consisting of the word procedure
(optionally
preceded by the word algebraic
), followed by the name of the procedure to be
defined, and followed by its formal parameters – the symbols that will be used
in the body of the definition to illustrate what is to be done. There are three
cases:
procedure abc;
When such a procedure is used in an expression or command, abc()
, with empty
parentheses, must be written.
procedure abc(x);
or
procedure abc x;
procedure abc(x,y,z);
Referring to the last example, if later in some expression being evaluated the symbols
abc(u,p*q,123)
appear, the operations of the procedure body will be carried out as
if x
had the same value as u
does, y
the same value as p*q
does, and z
the value 123.
The values of x
, y
, z
, after the procedure body operations are completed are unchanged.
So, normally, are the values of u
, p
, q
, and (of course) 123. (This is technically referred
to as call by value.)
The reader will have noted the word normally a few lines earlier. The call by value protections can be bypassed if necessary, as described elsewhere.
Up | Next | Front |