[previous] [up] [next]     [contents] [index]
Next: ObjectsClasses, and Interfaces Up: Units Previous: Units

Library Functions

Scheme_Object *scheme_invoke_unit(Scheme_Object *unit, int num_ins, 
               Scheme_Object **ins, Scheme_Object **anchors) 

Invokes a unit in the given namespace. 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.

Scheme_Object *scheme_make_enunvbox(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.


[previous] [up] [next]     [contents] [index]
Next: ObjectsClasses, and Interfaces Up: Units Previous: Units

PLT