Provide more information in `hash/c' error messages.

Signed-Off-By: sstrickl

svn: r17279
This commit is contained in:
Sam Tobin-Hochstadt 2009-12-13 03:17:05 +00:00
parent 961ece3ffe
commit fde17c1567

View File

@ -1198,14 +1198,14 @@
(λ (val)
(unless (hash? val)
(raise-contract-error val src-info pos-blame orig-str
"expected a hash"))
"expected a hash, got ~a" val))
(case immutable
[(#t) (unless (immutable? val)
(raise-contract-error val src-info pos-blame orig-str
"expected an immutable hash"))]
"expected an immutable hash, got ~a" val))]
[(#f) (when (immutable? val)
(raise-contract-error val src-info pos-blame orig-str
"expected a mutable hash"))]
"expected a mutable hash, got ~a" val))]
[(dont-care) (void)])
(hash-for-each