fixed indexing and typo; Closes PR 14575, Closes PR 14564

This commit is contained in:
Matthias Felleisen 2014-06-14 15:11:14 -04:00
parent 76c3ec443f
commit 3df3cd2b9d

View File

@ -4,11 +4,17 @@
@(define the-eval (make-base-eval))
@(the-eval '(require racket/contract unstable/options))
@title[#:tag "options"]{Options}
@title[#:tag "options"]{Option Contracts}
@unstable-header[]
@defmodule[unstable/options]
This module introduces @defterm{option contracts}, a flavor of behavioral
software contracts. With option contracts developers control in a
programmatic manner whether, when, and how often contracts are
checked. Using this flavor of contracts, Racketeers can mimic any compiler
flag system but also create run-time informed checking systems.
@defproc[(option/c [c contract?]
[#:with-contract with boolean? #f]
[#:tester tester (or/c (-> any boolean?) 'dont-care) 'dont-care]
@ -82,7 +88,7 @@ is a predicate. In any other case, the result is a contract error.
@defproc[(exercise-option [x any/c]) any/c]{
Returns @racket[x] with contract ckecking enabled if an @racket[option/c] guards
Returns @racket[x] with contract checking enabled if an @racket[option/c] guards
@racket[x]. In any other case it returns @racket[x]. The result of @racket[exercise-option]
loses the guard related to @racket[option/c], if it has one to begin with, and thus its contract checking status cannot change further.