|
|||||
Function predefinitions | |||||
Prerequisite Concepts | Related Syntax |
No special provision is required when declaring a function that calls itself, but if two functions are written such that each calls the other, it is impossible to define each function prior to its first use: one must precede the other. To support such mutually recursive functions, OmniMark provides function "predefinitions". A function predefinition looks just like a function definition except that it has no body. Instead of as
and a following set of local declarations and actions, there is just the keyword elsewhere
.
For example:
define function analyse-command-set (value stream command-set) elsewhere
Functions must be defined or predefined before they are used. For mutually recursive functions, one or more of the functions must be predefined prior to the first actual function definition.
Here are some rules for using function predefinitions:
Prerequisite Concepts Function types and anatomy Functions |
Related Syntax define function elsewhere |
---- |