Now change box/c to use proxies or chaperones appropriately.

Create a mzlib/contract compatible version of the old box/c and use that
for mzlib/contract.  Change the docs so that the docs for mzlib/contract
contain the right information.

Fix the typed-scheme implementation to only force flat box (or hash)
contracts when it already is required to be flat.  Otherwise, allow
non-flat contracts for the element contract (or domain/range contracts).

original commit: 994ad6d10fc817a5ceca2f9f4874dac5c14c0aab
This commit is contained in:
Stevie Strickland 2010-05-13 15:43:52 -04:00
parent 9d31fc0726
commit e7e187e1de

View File

@ -134,7 +134,9 @@
[(Vector: t)
#`(vectorof #,(t->c t #:flat #t))]
[(Box: t)
#`(box/c #,(t->c t #:flat #t))]
(if flat?
#`(box/c #,(t->c t #:flat #t) #:flat? #t)
#`(box/c #,(t->c t)))]
[(Pair: t1 t2)
#`(cons/c #,(t->c t1) #,(t->c t2))]
[(Opaque: p? cert)
@ -206,7 +208,10 @@
[(Syntax: t) #`(syntax/c #,(t->c t))]
[(Value: v) #`(flat-named-contract #,(format "~a" v) (lambda (x) (equal? x '#,v)))]
[(Param: in out) #`(parameter/c #,(t->c out))]
[(Hashtable: k v) #`(hash/c #,(t->c k #:flat #t) #,(t->c v #:flat #t) #:immutable 'dont-care)]
[(Hashtable: k v)
(if flat?
#`(hash/c #,(t->c k #:flat #t) #,(t->c v #:flat #t) #:flat? #t #:immutable 'dont-care)
#`(hash/c #,(t->c k) #,(t->c v) #:immutable 'dont-care))]
[else
(exit (fail))]))))