Procedure Definition

procedure-definition =
  proc name [( parameter-declarations )]
    {instruction}
  [endp]

parameter-declarations = 
  name {, name} [: type-expression [; parameter-declarations]]

Procedures may only appear at the global level. In other words, a procedure cannot be local to another procedure or function, nor nested inside a selection or loop instruction. Note that the syntax allows the start of a procedure definition to implicitly end the definition of the preceding procedure or function.

A procedure definition enters the procedure name into the name space of the module in which it appears. Like any name, procedure names can be used in expressions. When used in an expression, a procedure name results in a value of type Entity.

Note that every definition of a procedure generates a value distinct from all others. In other words, even if two procedure definitions are identical, the values their names result in when used in expressions are not equal.

See also: procedure call.


Herman Venter

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