Fixed a few bugs in set/c's keyword options, and one test for set/c.

Specifically, set/c no longer behaves as a flat contract, so it is necessary to
apply at least one set operation to detect a contract error on an element.  It
is possible the flat behavior can be restored for some kinds of sets, but it's
not immediately obvious what kinds those should be.  (Immutable hash sets in
particular?  Any sets that don't implement set-add! or set-remove!?)
This commit is contained in:
Carl Eastlund 2013-07-27 13:13:40 -04:00
parent 8aeadd314d
commit 1c7cdfb302
2 changed files with 6 additions and 6 deletions

View File

@ -13,9 +13,9 @@
(test/pos-blame
'set/c2
'(contract (set/c integer?)
'(set-first (contract (set/c integer?)
(set #t)
'pos 'neg))
'pos 'neg)))
(test/pos-blame
'set/c3

View File

@ -96,10 +96,10 @@
(unless (set-equal? x)
(raise-blame-error b x "expected an equal?-based set"))]
[(eqv)
(unless (set-equal? x)
(unless (set-eqv? x)
(raise-blame-error b x "expected an eqv?-based set"))]
[(eq)
(unless (set-equal? x)
(unless (set-eq? x)
(raise-blame-error b x "expected an eq?-based set"))])
(case kind
[(mutable-or-weak)
@ -109,7 +109,7 @@
(unless (set-mutable? x)
(raise-blame-error b x "expected a mutable set"))]
[(weak)
(unless (set-mutable? x)
(unless (set-weak? x)
(raise-blame-error b x "expected a weak set"))]
[(immutable)
(unless (set-immutable? x)