HP Pascal/iX Programmer's Guide (31502-90023)

8- 1
Chapter 8 Procedure Options
Procedure options, which immediately follow a routine head, can specify:
* That the routine has an extensible parameter list--that is, one or
more optional parameters (EXTENSIBLE option).
* Default values for formal parameters, allowing their actual
parameters to be left out of actual parameter lists (DEFAULT_PARMS
option).
* That formal ANYVAR parameters do not have the usual hidden
parameters that specify their sizes (UNCHECKABLE_ANYVAR option).
* That the loader does not resolve the routine until run time
(UNRESOLVED option).
* That the routine is duplicated in-line wherever the program calls
it (INLINE option).
A routine heading can specify any combination of procedure options.
Example
PROCEDURE alpha (a,b,c : integer)
OPTION EXTENSIBLE 2;
FUNCTION beta (x : integer; y : real) : boolean
OPTION DEFAULT_PARMS (x:=0, y:=0);
FUNCTION delta (i,j,k : integer) : integer
OPTION EXTENSIBLE 1
DEFAULT_PARMS (i:=0, j:=1, k:=1)
UNRESOLVED;
PROCEDURE gamma (ANYVAR r,s : char)
OPTION UNCHECKABLE_ANYVAR;
PROCEDURE epsilon (ANYVAR t : real)
OPTION UNRESOLVED
UNCHECKABLE_ANYVAR;
FUNCTION zeta (ANYVAR u : real) : integer
OPTION UNCHECKABLE_ANYVAR
DEFAULT_PARMS (u:=nil)
UNRESOLVED;
EXTENSIBLE
The EXTENSIBLE routine option identifies a procedure that has an
extensible parameter list.
An
extensible parameter list
has a fixed number of nonextension
parameters and a variable number of extension parameters. The integer
n
after the keyword EXTENSIBLE specifies that the first
n
parameters in the
formal parameter list are nonextension parameters (
n
can be zero). Any
other parameters are extension parameters.
A
nonextension parameter
is required. Every call to the routine must
provide an actual parameter for it.
An
extension parameter
is optional. A call to the routine can omit its
actual parameter from the actual parameter list. However, if the actual
parameter list contains an actual parameter for the
x
th extension
parameter, it must contain actual parameters for those before it.