syntax
init-depends-declunit-body-expr-or-defn...)
Evaluating a reference to a unit-id bound by define-unit produces a unit, just like evaluating an id bound by (define id(unit ... )). In addition, however, unit-id can be used in compound-unit/infer . See unit for information on tagged-sig-spec, init-depends-decl, and unit-body-expr-or-defn.
syntax
tagged-infer-link-import = tagged-sig-id| (link-id:tagged-sig-id)| infer-link-exportinfer-link-export = link-id| sig-idinfer-linkage-decl =((link-binding...)unit-idtagged-link-id...)| unit-id
The compound-unit/infer form expands to compound-unit by adding sig-ids as needed to the import clause, by replacing sig-ids in the export clause by link-ids, and by completing the declarations of the link clause. This completion is based on static information associated with each unit-id. Links and exports can be inferred when all signatures exported by the linked units are distinct from each other and from all imported signatures, and when all imported signatures are distinct. Two signatures are distinct only if they share no ancestor through extends .
The long form of a link declaration can be used to resolve ambiguity by giving names to some of a unit’s exports and supplying specific bindings for some of a unit’s imports. The long form need not name all of a unit’s exports or supply all of a unit’s imports if the remaining parts can be inferred.
When a unit declares initialization dependencies, compound-unit/infer checks that the link declaration is consistent with those dependencies, and it reports a syntax error if not.
Like compound-unit , the compound-unit/infer form produces a (compound) unit without statically binding information about the result unit’s imports and exports. That is, compound-unit/infer consumes static information, but it does not generate it. Two additional forms, define-compound-unit and define-compound-unit/infer , generate static information (where the former does not consume static information).
Changed in version 6.1.1.8 of package base: Added static checking of the link clause with respect to declared initialization dependencies.
syntax
syntax
syntax
unit-exprinit-depends-decl)
syntax
( invoke-unit/infer unit-spec)
unit-spec = unit-id
When assembling imports from the current context, the lexical information of a unit-id is used for constructing the lexical information of the signatures for the unit’s imports (i.e., the lexical information that would normally be derived from the signature reference). See define-signature for more information.
syntax
unit-specmaybe-exportsmaybe-results-clause)
Similar to invoke-unit/infer , the lexical information of a unit-id is used for constructing the lexical information of the signatures for the unit’s inferred imports and inferred exports (i.e., the lexical information that would normally be derived from a signature reference). See define-signature for more information.
If maybe-results-clause is provided, the values returned by the unit body are bound in the same way as define-values/invoke-unit .
For backwards compatibility, an export clause is allowed to appear before unit-spec (in which case no maybe-results-clause may be provided). New programs should provide unit-spec first (which is consistent with define-values/invoke-unit ).
Changed in version 8.8.0.7 of package base: Allowed unit-spec to appear before maybe-exports for consistency with define-values/invoke-unit and added maybe-results-clause.