original commit: c5cf4469f99049be8ae8b56cbdaebc87aa1070e9
This commit is contained in:
Robby Findler 2003-11-17 14:49:51 +00:00
parent c97809efad
commit 7c3ae6dd91

View File

@ -449,17 +449,26 @@ 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)
(procedure-arity-includes? predicate 1)) (procedure-arity-includes? predicate 1))