Fixed plot doc tests
Removed contract/c from unstable/contract
This commit is contained in:
parent
dc677998f0
commit
a94e1fc00e
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
(defcontract point-sym/c (or/c char? string? integer? (apply one-of/c known-point-symbols)))
|
(defcontract point-sym/c (or/c char? string? integer? (apply one-of/c known-point-symbols)))
|
||||||
|
|
||||||
(defcontract (maybe-function/c [in-contract contract/c] [out-contract contract/c])
|
(defcontract (maybe-function/c [in-contract contract?] [out-contract contract?])
|
||||||
(or/c out-contract (in-contract . -> . out-contract)))
|
(or/c out-contract (in-contract . -> . out-contract)))
|
||||||
|
|
||||||
(defproc (maybe-apply [f (maybe-function/c any/c any/c)]
|
(defproc (maybe-apply [f (maybe-function/c any/c any/c)]
|
||||||
|
@ -71,20 +71,20 @@
|
||||||
(cond [(procedure? f) (f arg)]
|
(cond [(procedure? f) (f arg)]
|
||||||
[else f]))
|
[else f]))
|
||||||
|
|
||||||
(defcontract (plot-colors/c [in-contract contract/c])
|
(defcontract (plot-colors/c [in-contract contract?])
|
||||||
(maybe-function/c in-contract (listof plot-color/c)))
|
(maybe-function/c in-contract (listof plot-color/c)))
|
||||||
|
|
||||||
(defcontract (pen-widths/c [in-contract contract/c])
|
(defcontract (pen-widths/c [in-contract contract?])
|
||||||
(maybe-function/c in-contract (listof (>=/c 0))))
|
(maybe-function/c in-contract (listof (>=/c 0))))
|
||||||
|
|
||||||
(defcontract (plot-pen-styles/c [in-contract contract/c])
|
(defcontract (plot-pen-styles/c [in-contract contract?])
|
||||||
(maybe-function/c in-contract (listof plot-pen-style/c)))
|
(maybe-function/c in-contract (listof plot-pen-style/c)))
|
||||||
|
|
||||||
(defcontract (plot-brush-styles/c [in-contract contract/c])
|
(defcontract (plot-brush-styles/c [in-contract contract?])
|
||||||
(maybe-function/c in-contract (listof plot-brush-style/c)))
|
(maybe-function/c in-contract (listof plot-brush-style/c)))
|
||||||
|
|
||||||
(defcontract (alphas/c [in-contract contract/c])
|
(defcontract (alphas/c [in-contract contract?])
|
||||||
(maybe-function/c in-contract (listof (real-in 0 1))))
|
(maybe-function/c in-contract (listof (real-in 0 1))))
|
||||||
|
|
||||||
(defcontract (labels/c [in-contract contract/c])
|
(defcontract (labels/c [in-contract contract?])
|
||||||
(maybe-function/c in-contract (listof (or/c string? #f))))
|
(maybe-function/c in-contract (listof (or/c string? #f))))
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
|
|
||||||
(doc plot/dc)
|
(doc plot/dc)
|
||||||
(newline)
|
(newline)
|
||||||
(doc treeof)
|
|
||||||
(newline)
|
|
||||||
(doc plot-background)
|
(doc plot-background)
|
||||||
(newline)
|
(newline)
|
||||||
(doc known-point-symbols)
|
(doc known-point-symbols)
|
||||||
|
|
|
@ -173,8 +173,6 @@
|
||||||
|
|
||||||
;; Added by ntoronto
|
;; Added by ntoronto
|
||||||
|
|
||||||
(define contract/c (or/c contract? (any/c . -> . any/c)))
|
|
||||||
|
|
||||||
(define (treeof elem-contract)
|
(define (treeof elem-contract)
|
||||||
(or/c elem-contract
|
(or/c elem-contract
|
||||||
(listof (recursive-contract (treeof elem-contract) #:flat))))
|
(listof (recursive-contract (treeof elem-contract) #:flat))))
|
||||||
|
@ -201,8 +199,6 @@
|
||||||
|
|
||||||
[sequence/c (->* [] [] #:rest (listof contract?) contract?)]
|
[sequence/c (->* [] [] #:rest (listof contract?) contract?)]
|
||||||
|
|
||||||
[contract/c contract?]
|
[treeof (contract? . -> . contract?)]
|
||||||
|
|
||||||
[treeof (contract/c . -> . contract?)]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -118,11 +118,7 @@ for instance, a wrapped list is not guaranteed to satisfy @racket[list?].
|
||||||
|
|
||||||
@addition{@author+email["Neil Toronto" "neil.toronto@gmail.com"]}
|
@addition{@author+email["Neil Toronto" "neil.toronto@gmail.com"]}
|
||||||
|
|
||||||
@defthing[contract/c contract?]{
|
@defproc[(treeof [elem-contract contract?]) contract?]{
|
||||||
Identifies contracts and predicates that can be used as contracts.
|
|
||||||
}
|
|
||||||
|
|
||||||
@defproc[(treeof [elem-contract contract/c]) contract?]{
|
|
||||||
Identifies values that meet the contract @racket[elem-contract], lists of such values, lists of lists, and so on.
|
Identifies values that meet the contract @racket[elem-contract], lists of such values, lists of lists, and so on.
|
||||||
@examples[#:eval the-eval
|
@examples[#:eval the-eval
|
||||||
(define number-tree/c (treeof number?))
|
(define number-tree/c (treeof number?))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user