..
original commit: c5cf4469f99049be8ae8b56cbdaebc87aa1070e9
This commit is contained in:
parent
c97809efad
commit
7c3ae6dd91
|
@ -449,16 +449,25 @@ add structu contracts for immutable structs?
|
||||||
;; the argument to the result function is the value to test.
|
;; the argument to the result function is the value to test.
|
||||||
;; (the result function is the projection)
|
;; (the result function is the projection)
|
||||||
|
|
||||||
(define-struct contract (name proc))
|
|
||||||
|
|
||||||
(define-values (make-flat-contract
|
(define-values (make-flat-contract
|
||||||
flat-contract-predicate
|
flat-contract-predicate
|
||||||
flat-contract?)
|
flat-contract?
|
||||||
|
|
||||||
|
make-contract
|
||||||
|
contract-name
|
||||||
|
contract-proc
|
||||||
|
contract?)
|
||||||
(let ()
|
(let ()
|
||||||
|
(define-struct contract (name proc))
|
||||||
(define-struct (flat-contract contract) (predicate))
|
(define-struct (flat-contract contract) (predicate))
|
||||||
(values make-flat-contract
|
(values make-flat-contract
|
||||||
flat-contract-predicate
|
flat-contract-predicate
|
||||||
flat-contract?)))
|
flat-contract?
|
||||||
|
|
||||||
|
make-contract
|
||||||
|
contract-name
|
||||||
|
contract-proc
|
||||||
|
contract?)))
|
||||||
|
|
||||||
(define (flat-contract predicate)
|
(define (flat-contract predicate)
|
||||||
(unless (and (procedure? predicate)
|
(unless (and (procedure? predicate)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user