subprogram_body ::= |
|||
subprogram_specification ::=
procedure
designator [ ( formal_parameter_list ) ]
| [
pure
|
impure
]
function
designator [ (
formal_parameter_list ) ]
return
type_mark
subprogram_declarative_part ::=
{ subprogram_declarative_item }
subprogram_statement_part ::=
{ sequential_statement }
subprogram_kind ::= procedure | function
designator ::= identifier | operator_symbol
The declaration of a subprogram is optional. The subprogram specification can act as the declaration.
Shared variables must not be declared in subprograms.
A "foreign subprogram" is a subprogram with the attribute FOREIGN . The value of the attribute (a string) can contain implementation specific information for linking the external program (see example below).
A pure function must not contain a reference to an explicitly declared file object.
A pure function must not be the parent of an impure function.