- After (normal) completion of the subprogram body: for a parameter of mode ininin outoutout or outoutout, it
is checked that the value of the formal parameter belongs to the subtype of the actual
variable. In the case of a type conversion, the value of the formal parameter is converted
back and the check applies to the result of the conversion.
6.5 Function Subprograms6.5 Function Subprograms6.5 Function Subprograms
The exception PROGRAM_ERROR is raised if a function body is left otherwise than by a return
statement. This does not apply if the execution of the function is abandoned as a result of an
6.5 Function Subprograms -2
exception.
6.6 Parameter and Result Type Profile - Overloading of Subprograms (paragraph 4)6.6 Parameter and Result Type Profile - Overloading of Subprograms (paragraph 4)6.6 Parameter and Result Type Profile - Overloading of Subprograms (paragr
Examples of overloaded subprograms:___________________________________
procedureprocedureprocedure PUT(X : INTEGER);
procedureprocedureprocedure PUT(X : STRING);
6.6 Parameter and Result Type Profile - Overloading of Subprograms (paragraph 7)6.6 Parameter and Result Type Profile - Overloading of Subprograms (paragraph 7)6.6 Parameter and Result Type Profile - Overloading of Subprograms (paragr
Ambiguities may (but need not) arise when actual parameters of the call of an overloaded
subprogram are themselves overloaded function calls, literals, or aggregates. Ambiguities may
also (but need not) arise when several overloaded subprograms belonging to different packages are
visible. These ambiguities can usually be resolved in several ways: qualified expressions can be
used for some or all actual parameters, and for the result, if any; the name of the subprogram
can be expressed more explicitly as an expanded name; finally, the subprogram can be renamed.
6.7 Overloading of Operators (paragraph 2)6.7 Overloading of Operators (paragraph 2)6.7 Overloading of Operators (paragraph 2)
The subprogram specification of a unary operator must have a single parameter. The subprogram
specification of a binary operator must have two parameters; for each use of this operator, the
first parameter takes the left operand as actual parameter, the second parameter takes the right
operand. Similarly, a generic function instantiation whose designator is an operator symbol is
only allowed if the specification of the generic function has the corresponding number of
parameters. Default expressions are not allowed for the parameters of an operator (whether the
operator is declared with an explicit subprogram specification or by a generic instantiation).