PR 10636
svn: r17163
This commit is contained in:
parent
ac1f4171fa
commit
61da010d5f
|
@ -66,9 +66,14 @@
|
|||
(define-values (flat-prop flat-pred? flat-get)
|
||||
(make-struct-type-property 'contract-flat))
|
||||
|
||||
(define-values (first-order-prop first-order-pred? first-order-get)
|
||||
(define-values (first-order-prop first-order-pred? raw-first-order-get)
|
||||
(make-struct-type-property 'contract-first-order))
|
||||
|
||||
(define (first-order-get stct)
|
||||
(cond
|
||||
[(flat-pred? stct) (flat-get stct)]
|
||||
[else (raw-first-order-get stct)]))
|
||||
|
||||
(define (contract-first-order-passes? c v)
|
||||
(let ([ctc (coerce-contract 'contract-first-order-passes? c)])
|
||||
(cond
|
||||
|
@ -404,7 +409,8 @@
|
|||
#:property name-prop (λ (ctc) (apply build-compound-type-name 'and/c (and/c-ctcs ctc)))
|
||||
#:property first-order-prop
|
||||
(λ (ctc)
|
||||
(let ([tests (map (λ (x) ((first-order-get x) x)) (and/c-ctcs ctc))])
|
||||
(let ([tests (map (λ (x) ((first-order-get x) x))
|
||||
(and/c-ctcs ctc))])
|
||||
(λ (x)
|
||||
(andmap (λ (f) (f x)) tests))))
|
||||
#:property stronger-prop
|
||||
|
|
|
@ -2060,6 +2060,12 @@
|
|||
x)
|
||||
'(2))
|
||||
|
||||
(test/spec-passed
|
||||
'or/c-hmm
|
||||
(let ([funny/c (or/c (and/c procedure? (-> any)) (listof (-> number?)))])
|
||||
(contract (-> funny/c any) void 'pos 'neg)))
|
||||
|
||||
|
||||
|
||||
;
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue
Block a user