A unit is invoked using the invoke-unit
form:
(invoke-unit f import-variable
invokes the unit f and returns the value of the last
expression within the unit's body. If f is a compound
unit, the return value is the invocation value of the last
sub-unit specified in the compound unit's with clause.
)
The number of supplied import-variables must be the same as the number of variables imported by the unit f. Each import-variable must be a global variable; within a unit body, each import-variable must be a built-in global or an imported or exported variable.
When a unit is invoked with invoke-unit, references to built-in global variables in the unit are linked with global variables from the global variable space of the invoke-unit expression.
The invoke-open-unit procedure is useful for exploring
definitions within units:
(invoke-open-unit f name-specifier import-variable
invokes the unit f like invoke-unit, but some of the
unit's internal variables are created as global variables. The way
in which internal names are created as global variables depends on
the name-specifier clause (which is not an expression):
)
(invoke-open-unit f1@ (A W))invokes f1@, where f1@ must be a compound unit with a sub-unit tagged with A. This sub-unit must also be a compound unit with a sub-unit tagged W. The internal variables of the sub-unit tagged W are created as globals.
Each globals variable is created using the internal name of the unit variable. The internal variables of a compound unit are all of the internal variables of its subunits; each internal variable name in a compound unit is the internal name in the sub-unit prefixed with the sub-unit's tag and a colon (``:'').