update the docs for ->i

(should have been in commit 506c9be0cd)
This commit is contained in:
Robby Findler 2015-12-19 18:35:32 -06:00
parent bd4b243963
commit 783443f9d7

View File

@ -1094,18 +1094,21 @@ symbols, and that return a symbol.
} }
@defform*/subs[#:literals (any values) @defform*/subs[#:literals (any values)
[(->i (mandatory-dependent-dom ...) [(->i maybe-chaperone
(mandatory-dependent-dom ...)
dependent-rest dependent-rest
pre-condition pre-condition
dependent-range dependent-range
post-condition) post-condition)
(->i (mandatory-dependent-dom ...) (->i maybe-chaperone
(mandatory-dependent-dom ...)
(optional-dependent-dom ...) (optional-dependent-dom ...)
dependent-rest dependent-rest
pre-condition pre-condition
dependent-range dependent-range
post-condition)] post-condition)]
([mandatory-dependent-dom id+ctc ([maybe-chaperone #:chaperone (code:line)]
[mandatory-dependent-dom id+ctc
(code:line keyword id+ctc)] (code:line keyword id+ctc)]
[optional-dependent-dom id+ctc [optional-dependent-dom id+ctc
(code:line keyword id+ctc)] (code:line keyword id+ctc)]
@ -1140,6 +1143,12 @@ combinator in that each argument and result is named and these names can
be used in the subcontracts and in the pre-/post-condition clauses. be used in the subcontracts and in the pre-/post-condition clauses.
In other words, @racket[->i] expresses dependencies among arguments and results. In other words, @racket[->i] expresses dependencies among arguments and results.
The optional first keyword argument to @racket[->i] indicates if the result
contract will be a chaperone. If it is @racket[#:chaperone], all of the contract for the arguments
and results must be chaperone contracts and the result of @racket[->i] will be
a chaperone contract. If it is not present, then the result
contract will not be a chaperone contract.
The first sub-form of a @racket[->i] contract covers the mandatory and the The first sub-form of a @racket[->i] contract covers the mandatory and the
second sub-form covers the optional arguments. Following that is an optional second sub-form covers the optional arguments. Following that is an optional
rest-args contract, and an optional pre-condition. The pre-condition is rest-args contract, and an optional pre-condition. The pre-condition is