fix wrong name in docs
This commit is contained in:
parent
b826b176d2
commit
1b834d010a
|
@ -126,18 +126,18 @@ and how they can be used to implement contracts.
|
||||||
@section[#:tag "data-structure-contracts"]{Data-structure Contracts}
|
@section[#:tag "data-structure-contracts"]{Data-structure Contracts}
|
||||||
@declare-exporting-ctc[racket/contract/base]
|
@declare-exporting-ctc[racket/contract/base]
|
||||||
|
|
||||||
@defproc[(flat-contract-with-reason [get-reason (-> any/c (or/c boolean? (-> blame? any)))])
|
@defproc[(flat-contract-with-explanation [get-explanation (-> any/c (or/c boolean? (-> blame? any)))])
|
||||||
flat-contract?]{
|
flat-contract?]{
|
||||||
Provides a way to use flat contracts that, when a contract fails,
|
Provides a way to use flat contracts that, when a contract fails,
|
||||||
provide more information about the failure.
|
provide more information about the failure.
|
||||||
|
|
||||||
If @racket[get-reason] returns a boolean, then that boolean value is
|
If @racket[get-explanation] returns a boolean, then that boolean value is
|
||||||
treated as the predicate in a @tech{flat contract}. If it returns
|
treated as the predicate in a @tech{flat contract}. If it returns
|
||||||
a procedure, then it is treated similarly to returning @racket[#f],
|
a procedure, then it is treated similarly to returning @racket[#f],
|
||||||
except the result procedure is called to actually signal the contract
|
except the result procedure is called to actually signal the contract
|
||||||
violation.
|
violation.
|
||||||
|
|
||||||
@racketblock[(flat-contract-with-reason
|
@racketblock[(flat-contract-with-explanation
|
||||||
(λ (val)
|
(λ (val)
|
||||||
(cond
|
(cond
|
||||||
[(even? val) #t]
|
[(even? val) #t]
|
||||||
|
@ -2098,7 +2098,7 @@ accepted by the third argument to @racket[datum->syntax].
|
||||||
These functions build simple higher-order contracts, @tech{chaperone contracts},
|
These functions build simple higher-order contracts, @tech{chaperone contracts},
|
||||||
and @tech{flat contracts}, respectively. They both take the same set of three
|
and @tech{flat contracts}, respectively. They both take the same set of three
|
||||||
optional arguments: a name, a first-order predicate, and a blame-tracking projection.
|
optional arguments: a name, a first-order predicate, and a blame-tracking projection.
|
||||||
For @racket[make-flat-contract], see also @racket[flat-contract-with-reason].
|
For @racket[make-flat-contract], see also @racket[flat-contract-with-explanation].
|
||||||
|
|
||||||
The @racket[name] argument is any value to be rendered using @racket[display] to
|
The @racket[name] argument is any value to be rendered using @racket[display] to
|
||||||
describe the contract when a violation occurs. The default name for simple
|
describe the contract when a violation occurs. The default name for simple
|
||||||
|
|
Loading…
Reference in New Issue
Block a user