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