Delete racket/exists paragraph (#2873)

* Delete racket/exists paragraph

* Remove @ctc-link for exists-gotcha
This commit is contained in:
Sage Gerard 2019-11-02 21:36:14 -04:00 committed by Ben Greenman
parent 2edea7db0d
commit eb20dc4463
2 changed files with 0 additions and 22 deletions

View File

@ -56,4 +56,3 @@ To ensure that the queue representation is abstract, we can use @racket[#:∃] i
Now, if clients of the data structure try to use @racket[car] and @racket[cdr], they
receive an error, rather than mucking about with the internals of the queues.
See also @ctc-link["exists-gotcha"].

View File

@ -108,27 +108,6 @@ Moral: if two values with contracts should interact,
put them in separate modules with contracts at
the module boundary or use @racket[#:freevar].
@ctc-section[#:tag "exists-gotcha"]{Exists Contracts and Predicates}
Much like the @racket[eq?] example above, @racket[#:∃] contracts
can change the behavior of a program.
Specifically,
the @racket[null?] predicate (and many other predicates) return @racket[#f]
for @racket[#:∃] contracts, and changing one of those contracts to @racket[any/c]
means that @racket[null?] might now return @racket[#t] instead, resulting in
arbitrarily different behavior depending on how this boolean might flow around
in the program.
@defmodulelang[racket/exists]
To work around the above problem, the
@racketmodname[racket/exists] library behaves just like @racketmodname[racket],
but predicates signal errors when given @racket[#:∃] contracts.
Moral: Do not use predicates on @racket[#:∃] contracts, but if you're not sure, use
@racketmodname[racket/exists] to be safe.
@ctc-section{Defining Recursive Contracts}
When defining a self-referential contract, it is natural to use