improve string-split-lens error message

This commit is contained in:
AlexKnauth 2016-09-15 16:14:24 -04:00
parent c7b5783088
commit 6af441c592

View File

@ -21,7 +21,7 @@
[(string? sep) (regexp (regexp-quote sep))]
[(char? sep) (regexp (regexp-quote (string sep)))]
[(regexp? sep) sep]
[else (error 'bad)]))
[else (error 'string-split-lens "expected a string, char, or regexp, given: ~v" sep)]))
(define (get str)
(map string->immutable-string (regexp-split sep-rx str)))
(define (set str lst)