fix to string to fulfill contract on empty input

This commit is contained in:
John Clements 2011-05-26 14:50:24 -07:00
parent 2c470ee82a
commit 53cfbd27c1

View File

@ -3,7 +3,10 @@
racket/serialize)
(define (read/string str)
(read (open-input-string str)))
(match (read (open-input-string str))
[(? eof-object? e) (raise-type-error 'read/string "nonempty string" str)]
[other other]))
;; Eli: Same comments as `read/bytes'.
(define (write/string v)