Fix up docs for flat-named-contract.

svn: r16929
This commit is contained in:
Stevie Strickland 2009-11-20 21:35:26 +00:00
parent 71eef1bbd8
commit 2a7664eba8

View File

@ -61,16 +61,19 @@ Constructs a @tech{flat contract} from @scheme[predicate]. A value
satisfies the contract if the predicate returns a true 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?]{ 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. (quoted) name of a contract used for error reporting.
For example, For example,
@schemeblock[(flat-named-contract @schemeblock[(flat-named-contract
'odd-integer 'odd-integer
(lambda (x) (and (integer? x) (odd? x))))] (lambda (x) (and (integer? x) (odd? x))))]
turns the predicate into a contract with the name @tt{odd-integer}. 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?]{ @defthing[any/c flat-contract?]{