Go to the first, previous, next, last section, table of contents.
The following keywords are used to specify the semantics of a procedure.
They typically appear as comments immediately below the procedure's
prototype in the module's .h file. The absence of a keyword indicates
that the procedure's behavior in that respect conforms to widely-held
expectations.
- Arguments:
-
Describes semantics of procedure arguments.
- Requires:
-
Describes preconditions required for correct operation.
Required when these preconditions are not evident
from the names and types of the arguments.
Unless it is unusually costly to do so, the procedure should verify its
preconditions in safe compilations.
- Effect(s):
-
Describes side-effect(s) of the procedure call.
Required when the procedure mutates one of its arguments or a global variable.
- Returns:
-
Describes the meaning of the value returned by the procedure.
- Error:
-
Describes conditions under which the procedure will raise a fatal error.
Required when the procedure call raises an error in both
safe and unsafe compilations.
- Cost:
-
States the computational cost of the procedure call (time and space).
This keyword is required when the procedure call is unusually costly
with respect to theoretical lower bounds.
- Warning:
-
Warns user about any common
misunderstanding regarding the procedure's semantics.
- Note:
-
Miscellaneous comment not included by one of the more specific
keywords above.
Go to the first, previous, next, last section, table of contents.