Rework the docs so that we're explicit about how the variables in contract
expressions are bound. svn: r13563
This commit is contained in:
parent
387c8b210f
commit
dc78217029
|
@ -160,9 +160,9 @@ the corresponding import. Each @scheme[tagged-sig-id] in an
|
||||||
|
|
||||||
[sig-elem
|
[sig-elem
|
||||||
id
|
id
|
||||||
(contracted [id contract] ...)
|
|
||||||
(define-syntaxes (id ...) expr)
|
(define-syntaxes (id ...) expr)
|
||||||
(define-values (value-id ...) expr)
|
(define-values (value-id ...) expr)
|
||||||
|
(contracted [id contract] ...)
|
||||||
(open sig-spec)
|
(open sig-spec)
|
||||||
(sig-form-id . datum)])]{
|
(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
|
importing the signature, and @scheme[id] must be defined by units
|
||||||
exporting the signature.}
|
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
|
@item{Each @scheme[define-syntaxes] form in a signature declaration
|
||||||
introduces a macro to that is available for use in any unit that
|
introduces a macro to that is available for use in any unit that
|
||||||
imports the signature. Free variables in the definition's
|
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
|
signature. Free variables in the definition's @scheme[expr] are
|
||||||
treated the same as for @scheme[define-syntaxes].}
|
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
|
@item{Each @scheme[(open sig-spec)] adds to the signature everything
|
||||||
specified by @scheme[sig-spec].}
|
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
|
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
|
superset of the export signatures listed in the unit contract. Any
|
||||||
identifier which is not listed for a given signature is left alone.
|
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]:
|
Here is an example use of @scheme[unit/c]:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user