There are two forms of procedure declaration:
PROCEDURE id sig = B id PROCEDURE id sigwhere
id
is an identifier, sig
is a procedure signature, and
B
is a block. In both cases, the type of id
is the procedure
type determined by sig
. The first form is allowed only in modules; the
second form is allowed only in interfaces.
The first form declares id
as a procedure constant whose signature is
sig
, whose body is B
, and whose environment is the scope
containing the declaration. The parameter names are treated as if they were
declared at the outer level of B
; the parameter types and default
values are evaluated in the scope containing the procedure declaration. The
procedure name id
must be repeated after the END
that terminates
the body.
The second form declares id
to be a procedure constant whose signature
is sig
. The procedure body is specified in a module exporting the
interface, by a declaration of the first form.