fix to string to fulfill contract on empty input
This commit is contained in:
parent
2c470ee82a
commit
53cfbd27c1
|
@ -3,7 +3,10 @@
|
||||||
racket/serialize)
|
racket/serialize)
|
||||||
|
|
||||||
(define (read/string str)
|
(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'.
|
;; Eli: Same comments as `read/bytes'.
|
||||||
|
|
||||||
(define (write/string v)
|
(define (write/string v)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user