Scheme_Object *scheme_invoke_unit(Scheme_Object *unit, int num_ins, Scheme_Object **ins, Scheme_Object **anchors, int tail, int multi)
Invokes a unit. The num_ins argument specifies the number of variables to import into the unit. The ins array must be an array of variables boxes (NULL if no variables are imported). The anchors argument is is parallel to the ins array, providing a garbage-collecting anchor for each variable. The scheme_invoke_unit function will check that the correct number of variables are provided for importing into the unit.
A variable box can be any pointer. The pointer is deferenced as a Scheme_Object ** to get the variable box's contents. Anchors are associated with variable boxes so that a box can point into the middle of an allocated array; in this case, the anchor would be the start of the array, so that the garbage collector sees a reference to the array.
If tail is non-zero, scheme_invoke_unit produces a tail-call to invoke the unit. If tail is zero and multi is non-zero, multiple values may be returned.
Scheme_Object *scheme_make_envunbox(Scheme_Object *v)
Creates a new variable box with v as the initial value. No anchor is needed (i.e., NULL can be used as an anchor) for boxes created this way.
Scheme_Object *scheme_assemble_compound_unit(Scheme_Object *imports, Scheme_Object *links, Scheme_Object *exports)
``Compiles'' a compound-unit expression, given the names for the compound unit's imports, exports, and sub-unit linking.
The return value is an ``assembled'' compound unit. A compound unit is created from the assembly with scheme_make_compound_unit.
Scheme_Object *scheme_make_compound_unit(Scheme_Object *assembly, Scheme_Object **subs)
Returns a compound unit given an assembly created by scheme_assemble_compound_unit and an array of sub-units to be linked into the compound unit. The order of units in the sub-unit array should parallel the order of tags in the assembly's links specification.