From 11484b9d3461d5e6a8ee1013361f01d3763626d4 Mon Sep 17 00:00:00 2001 From: Ben Greenman Date: Mon, 1 May 2017 18:26:01 -0400 Subject: [PATCH] doc: explain blame object passed to late-neg The blame object passed to a late-neg-proj function will be missing one party. The missing party is sometimes the negative party and sometimes the positive party. --- .../scribblings/reference/contracts.scrbl | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/contracts.scrbl b/pkgs/racket-doc/scribblings/reference/contracts.scrbl index afdf2bf34e..4e2b74a2e5 100644 --- a/pkgs/racket-doc/scribblings/reference/contracts.scrbl +++ b/pkgs/racket-doc/scribblings/reference/contracts.scrbl @@ -2185,14 +2185,14 @@ the value of @racket[(contract-first-order-okay-to-give-up?)] (see it's document for more explanation). The @racket[late-neg-proj] argument defines the behavior of applying - the contract via a @deftech{late neg projection}. If it is - supplied, it accepts a @tech{blame object} that does not have a value for - the @racket[blame-negative] field. Then it must return a function that accepts - both the value that is getting the contract and the name of the blame party, in - that order. The result must either be the value (perhaps suitably wrapped - with a @tech{chaperone} or @tech{impersonator} to enforce the contract), or - signal a contract violation using @racket[raise-blame-error]. The default is - @racket[#f]. + the contract via a @deftech{late neg projection}. If it is supplied, this + argument accepts a @tech{blame object} that is missing one party (see also + @racket[blame-missing-party?]). Then it must return a function that accepts + both the value that is getting the contract and the name of the missing blame + party, in that order. The result must either be the value (perhaps suitably + wrapped with a @tech{chaperone} or @tech{impersonator} to enforce the + contract), or signal a contract violation using @racket[raise-blame-error]. + The default is @racket[#f]. The projection @racket[proj] and @racket[val-first-proj] are older mechanisms for defining the behavior of applying the contract. The @racket[proj] argument @@ -2366,7 +2366,7 @@ recognized automatically and do not require this form. If your combinator's projections operate on complete @tech{blame objects} (i.e., no missing blame parties), the @tech{blame object} should be the first argument to this form. Otherwise (e.g., in the case of @racket[_late-neg] projections), a pair -of the @tech{blame object} and the negative party should be used instead. +of the @tech{blame object} and the missing party should be used instead. @history[#:added "6.4.0.4"] } @@ -3085,7 +3085,7 @@ Produces the name used to describe the contract in error messages. the contract checking, mostly used to create a meaningful error message if a contract violation is detected. The resulting function's first argument is the value that should have the contract and its second argument is - a ``missing party'' from the @tech{blame object}, to be passed to @racket[raise-contract-error]. + a missing party for the @tech{blame object}, to be passed to @racket[raise-contract-error]. If possible, use this function instead of @racket[contract-val-first-projection] or @racket[contract-projection].