From 2d8f41bfb9dc372399557be22d325a5ccda1b5d0 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 18 Jun 2012 11:25:24 -0500 Subject: [PATCH] clarify has-contract? and prop:contracted relationship --- collects/scribblings/reference/contracts.scrbl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/collects/scribblings/reference/contracts.scrbl b/collects/scribblings/reference/contracts.scrbl index 8f5f4dff61..12f065579f 100644 --- a/collects/scribblings/reference/contracts.scrbl +++ b/collects/scribblings/reference/contracts.scrbl @@ -1778,7 +1778,8 @@ constructed by @racket[build-flat-contract-property]. These properties attach a contract value to the protected structure, chaperone, or impersonator value. The function @racket[has-contract?] returns @racket[#t] for values that have one of these properties, and -@racket[value-contract] extracts the contract value. +@racket[value-contract] extracts the value from the property (which +is expected to be the contract on the value). } @deftogether[( @@ -2095,11 +2096,17 @@ Produces the name used to describe the contract in error messages. @defproc[(value-contract [v has-contract?]) contract?]{ Returns the contract attached to @racket[v], if recorded. Otherwise it returns @racket[#f]. + + To support @racket[value-contract] and @racket[has-contract?] + in your own contract combinators, use @racket[prop:contracted] or + @racket[impersonator-prop:contracted]. } @defproc[(has-contract? [v any/c]) boolean?]{ Returns @racket[#t] if @racket[v] is a value that has a recorded contract attached to it. + + See also @racket[value-contract]. }