Add docs for version of define/contract that is in mzlib/contract.
svn: r11719
This commit is contained in:
parent
03347cc390
commit
0d1b217bce
|
@ -85,3 +85,23 @@ from @schememodname[scheme/contract]:
|
|||
vector-immutableof
|
||||
vector/c
|
||||
vectorof]
|
||||
|
||||
It also provides the old version of @scheme[define/contract]:
|
||||
|
||||
@defform[(define/contract id contract-expr init-value-expr)]{
|
||||
|
||||
Attaches the contract @scheme[contract-expr] to
|
||||
@scheme[init-value-expr] and binds that to @scheme[id].
|
||||
|
||||
The @scheme[define/contract] form treats individual definitions as
|
||||
units of blame. The definition itself is responsible for positive
|
||||
(co-variant) positions of the contract and each reference to
|
||||
@scheme[id] (including those in the initial value expression) must
|
||||
meet the negative positions of the contract.
|
||||
|
||||
Error messages with @scheme[define/contract] are not as clear as those
|
||||
provided by @scheme[provide/contract], because
|
||||
@scheme[define/contract] cannot detect the name of the definition
|
||||
where the reference to the defined variable occurs. Instead, it uses
|
||||
the source location of the reference to the variable as the name of
|
||||
that definition.}
|
||||
|
|
Loading…
Reference in New Issue
Block a user