previous up next     contents index
Next: Signed Compound Units Up: Units with Signatures Previous: Signatures

Signed Units

The syntax of a  unit/sig expression is:

 
   (unit/sig signature 
     (import import-element  tex2html_wrap_inline3141 ) 
     (rename (id id)  tex2html_wrap_inline3141 ) 
     signed-unit-body-clause 
      tex2html_wrap_inline3141 ) 

The initial signature specifies the export signature of the signed unit. All of the variables declared in the signature must be defined in the signed-unit-body-clauses (in any order), modulo the rename clause mapping. The export signature cannot have any sub-signatures, since a simple signed unit cannot define sub-units.

The import-elements define import variables. Each import-element has one of these forms:

 
   signature 
   (id : signature) 
In either case, this signed unit must be linked with another unit whose export signature matches signature. In the first form, the variables of signature are bound in the body expressions and will be imported at invocation time. If signature contains sub-signatures, the variables of each sub-signature are available with an id: prefix, where id is the sub-signature's identifier. (Sub-signature prefixing is applied recursively to the sub-signatures) In the second form of import-element, all identifiers are given an additional id: prefix.

The rename clause is optional. If it is present, it maps internally defined identifiers to exported identifers in the signature. The first id of each pair is a variable defined in the unit/sig body, and the second id of the pair is a variable in the export signature.

Each signed-unit-body-clause is like a unit body expression, with one additional special form: if a signed-unit-body-clause has the form (include filename), then the file named by filename is textually substituted into the unit/sig body in the place of the  include form.



PLT