From 913f6365f91fdf9722ea3e7be8b9b3c1dc12429c Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Fri, 20 Jul 2012 10:37:37 -0400 Subject: [PATCH] fixed a somewhat awkward error message that made 'system' look awkward (manually adapted) (cherry picked from commit f2b9cdaadd610e628a04e705710817619951d31d) --- collects/mzlib/process.rkt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/collects/mzlib/process.rkt b/collects/mzlib/process.rkt index 49f556232e..c527604bae 100644 --- a/collects/mzlib/process.rkt +++ b/collects/mzlib/process.rkt @@ -59,7 +59,7 @@ (raise-mismatch-error who "expected a single string argument after: " - (car args))) + (car args))) (unless (and (>= 2 (length args)) (string? (cadr args)) (path-or-ok-string? (cadr args))) @@ -78,17 +78,20 @@ (raise-argument-error who (string-append "(or/c path-string?\n" - " (and/c bytes? (lambda (bs) (not (memv 0 (bytes->list bs))))))") + " (and/c bytes? bytes-no-nuls?))") s)))]) args) +;; MF: fxing a somewhat awkward looking error message. Comment for Matthew in case he wants to improve on it. +(provide string-no-nuls? bytes-no-nuls?) + (define (check-command who str) (unless (or (string-no-nuls? str) (bytes-no-nuls? str)) (raise-argument-error who - (string-append "(or/c (and/c string? (lambda (s) (not (memv #\\nul (string->list s)))))\n" - " (and/c bytes? (lambda (bs) (not (memv 0 (bytes->list bs))))))") + (string-append "(or/c (and/c string? string-no-nuls?)\n" + " (and/c bytes? bytes-no-nuls?))") str))) ;; Old-style functions: ----------------------------------------