diff --git a/collects/scribblings/reference/units.scrbl b/collects/scribblings/reference/units.scrbl index 96604ac8b1..158ae26a1a 100644 --- a/collects/scribblings/reference/units.scrbl +++ b/collects/scribblings/reference/units.scrbl @@ -160,9 +160,9 @@ the corresponding import. Each @scheme[tagged-sig-id] in an [sig-elem id - (contracted [id contract] ...) (define-syntaxes (id ...) expr) (define-values (value-id ...) expr) + (contracted [id contract] ...) (open sig-spec) (sig-form-id . datum)])]{ @@ -177,15 +177,6 @@ of bindings for import or export: importing the signature, and @scheme[id] must be defined by units exporting the signature.} - @item{Each @scheme[contracted] form in a signature declaration means - that a unit exporting the signature must supply a variable definition - for each @scheme[id] in that form. If the signature is imported, then - uses of @scheme[id] inside the unit are protected by the appropriate - contracts using the unit as the negative blame. If the signature is - exported, then the exported values are protected by the appropriate - contracts which use the unit as the positive blame, but internal uses - of the exported identifiers are not protected.} - @item{Each @scheme[define-syntaxes] form in a signature declaration introduces a macro to that is available for use in any unit that imports the signature. Free variables in the definition's @@ -198,6 +189,17 @@ of bindings for import or export: signature. Free variables in the definition's @scheme[expr] are treated the same as for @scheme[define-syntaxes].} + @item{Each @scheme[contracted] form in a signature declaration means + that a unit exporting the signature must supply a variable definition + for each @scheme[id] in that form. If the signature is imported, then + uses of @scheme[id] inside the unit are protected by the appropriate + contracts using the unit as the negative blame. If the signature is + exported, then the exported values are protected by the appropriate + contracts which use the unit as the positive blame, but internal uses + of the exported identifiers are not protected. Variables in the + @scheme[contract] expressions are treated the same as for + @scheme[define-syntaxes].} + @item{Each @scheme[(open sig-spec)] adds to the signature everything specified by @scheme[sig-spec].} @@ -644,6 +646,9 @@ without adding contracts to the imported and exported signatures. The unit value must import a subset of the import signatures and export a superset of the export signatures listed in the unit contract. Any identifier which is not listed for a given signature is left alone. +Variables used in a given @scheme[ctc] expression first refer to other +variables in the same signature, and then to the context of the +@scheme[unit/c] expression. Here is an example use of @scheme[unit/c]: