From 2a7664eba873087b19f1a6a5dd3657385fac705d Mon Sep 17 00:00:00 2001 From: Stevie Strickland Date: Fri, 20 Nov 2009 21:35:26 +0000 Subject: [PATCH] Fix up docs for flat-named-contract. svn: r16929 --- collects/scribblings/reference/contracts.scrbl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/collects/scribblings/reference/contracts.scrbl b/collects/scribblings/reference/contracts.scrbl index 8d315d675e..25566f9a8e 100644 --- a/collects/scribblings/reference/contracts.scrbl +++ b/collects/scribblings/reference/contracts.scrbl @@ -61,16 +61,19 @@ Constructs a @tech{flat contract} from @scheme[predicate]. A value satisfies the contract if the predicate returns a true value.} -@defproc[(flat-named-contract [type-name any/c][predicate (any/c . -> . any)]) +@defproc[(flat-named-contract [type-name any/c] [predicate (or/c flat-contract? (any/c . -> . any))]) flat-contract?]{ -Like @scheme[flat-contract], but the first argument must be the +On predicates like @scheme[flat-contract], but the first argument must be the (quoted) name of a contract used for error reporting. For example, @schemeblock[(flat-named-contract 'odd-integer (lambda (x) (and (integer? x) (odd? x))))] turns the predicate into a contract with the name @tt{odd-integer}. + +On flat contracts, the new flat contract is the same as the old except for +the name. } @defthing[any/c flat-contract?]{