restore set/c default #:kind to 'immutable; update tests and docs to match

This commit is contained in:
Stephen Chang 2014-10-29 16:47:58 -04:00
parent 40422d35d3
commit ef34c5db01
3 changed files with 5 additions and 6 deletions

View File

@ -203,7 +203,7 @@ named by the @racket[sym]s.
'dont-care]
[#:kind kind
(or/c 'dont-care 'immutable 'mutable 'weak 'mutable-or-weak)
'dont-care])
'immutable])
contract?]{
Constructs a contract that recognizes sets whose elements match

View File

@ -586,15 +586,14 @@
;; check dont-care defaults
(test #t set? (app-ctc (set/c any/c) (set)))
(test #t set-mutable? (app-ctc (set/c any/c) (mutable-set)))
(test #t set? (app-ctc (set/c any/c) (seteq)))
(test #t set-mutable? (app-ctc (set/c any/c) (mutable-seteqv)))
(test/blame-pos (app-ctc (set/c any/c) (mutable-set))) ; check immutable default
(test/blame-pos (app-ctc (set/c any/c #:cmp 'eq) (set)))
(test/blame-pos (app-ctc (set/c any/c #:kind 'mutable) (set)))
(test/blame-pos (app-ctc (set/c string? #:kind 'immutable) (set 1)))
(test #t set? (app-ctc (set/c string?) (set 1))) ; ok bc we get a ho contract
(test/blame-pos (app-ctc (set/c string?) (set 1)))
(test/blame-pos (set-first (app-ctc (set/c string?) (set 1))))
(test/blame-neg (set-add! (app-ctc (set/c string?) (mutable-set)) 1))
(test/blame-neg (set-add! (app-ctc (set/c string? #:kind 'mutable) (mutable-set)) 1))
(report-errs)

View File

@ -12,7 +12,7 @@
(define (set/c elem/c
#:cmp [cmp 'dont-care]
#:kind [kind 'dont-care])
#:kind [kind 'immutable])
(define cmp/c
(case cmp
[(dont-care) any/c]