add docs for the #:stronger argument to the contract constructors

closes PR 12312
This commit is contained in:
Robby Findler 2011-10-31 16:59:19 -05:00
parent 0ce6c75591
commit 8edfd4e87e

View File

@ -1320,7 +1320,8 @@ the contract library primitives below.
(if (test x) (if (test x)
x x
(raise-blame-error (raise-blame-error
b x "expected <~a>, given: ~e" name x))))]) b x "expected <~a>, given: ~e" name x))))]
[#:stronger stronger (-> contract? contract? boolean?)])
contract?] contract?]
@defproc[(make-chaperone-contract @defproc[(make-chaperone-contract
[#:name name any/c 'anonymous-chaperone-contract] [#:name name any/c 'anonymous-chaperone-contract]
@ -1331,7 +1332,8 @@ the contract library primitives below.
(if (test x) (if (test x)
x x
(raise-blame-error (raise-blame-error
b x "expected <~a>, given: ~e" name x))))]) b x "expected <~a>, given: ~e" name x))))]
[#:stronger stronger (-> contract? contract? boolean?)])
chaperone-contract?] chaperone-contract?]
@defproc[(make-flat-contract @defproc[(make-flat-contract
[#:name name any/c 'anonymous-flat-contract] [#:name name any/c 'anonymous-flat-contract]
@ -1342,7 +1344,8 @@ the contract library primitives below.
(if (test x) (if (test x)
x x
(raise-blame-error (raise-blame-error
b x "expected <~a>, given: ~e" name x))))]) b x "expected <~a>, given: ~e" name x))))]
[#:stronger stronger (-> contract? contract? boolean?)])
flat-contract?] flat-contract?]
)]{ )]{
@ -1380,6 +1383,10 @@ projection, or both; therefore, the two must be consistent. The existence of a
separate projection only serves to provide more specific error messages. Most separate projection only serves to provide more specific error messages. Most
flat contracts do not need to supply an explicit projection. flat contracts do not need to supply an explicit projection.
The @racket[stronger] argument is used to implement @racket[contract-stronger?]. The
first argument is always the contract itself and the second argument is whatever
was passed as the second argument to @racket[contract-stronger?].
@defexamples[#:eval (contract-eval) @defexamples[#:eval (contract-eval)
(define int/c (define int/c
(make-flat-contract #:name 'int/c #:first-order integer?)) (make-flat-contract #:name 'int/c #:first-order integer?))