previous up next     contents index
Next: Examples Up: Units Previous: Examples

Invoking Units

 

A unit is invoked using the  invoke-unit form:

 
  (invoke-unit f import-variable  tex2html_wrap_inline8722 ) 
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  tex2html_wrap_inline8722 ) 
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):
previous up next     contents index
Next: Examples Up: Units Previous: Examples

PLT