From eb20dc44634abf8524327a570090dac9ebdd121b Mon Sep 17 00:00:00 2001 From: Sage Gerard Date: Sat, 2 Nov 2019 21:36:14 -0400 Subject: [PATCH] Delete racket/exists paragraph (#2873) * Delete racket/exists paragraph * Remove @ctc-link for exists-gotcha --- .../scribblings/guide/contracts/exists.scrbl | 1 - .../scribblings/guide/contracts/gotchas.scrbl | 21 ------------------- 2 files changed, 22 deletions(-) diff --git a/pkgs/racket-doc/scribblings/guide/contracts/exists.scrbl b/pkgs/racket-doc/scribblings/guide/contracts/exists.scrbl index 4746e3152b..f901381efe 100644 --- a/pkgs/racket-doc/scribblings/guide/contracts/exists.scrbl +++ b/pkgs/racket-doc/scribblings/guide/contracts/exists.scrbl @@ -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"]. diff --git a/pkgs/racket-doc/scribblings/guide/contracts/gotchas.scrbl b/pkgs/racket-doc/scribblings/guide/contracts/gotchas.scrbl index 51a6b24cc6..cf35eb8fd6 100644 --- a/pkgs/racket-doc/scribblings/guide/contracts/gotchas.scrbl +++ b/pkgs/racket-doc/scribblings/guide/contracts/gotchas.scrbl @@ -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