diff --git a/collects/mzlib/kw.ss b/collects/mzlib/kw.ss index def1f7e..81b2e29 100644 --- a/collects/mzlib/kw.ss +++ b/collects/mzlib/kw.ss @@ -514,8 +514,7 @@ ;; raise an appropriate exception (define (error* who fmt . args) (raise (make-exn:fail:contract - (string->immutable-string - (apply format (string-append "~a: " fmt) who args)) + (apply format (string-append "~a: " fmt) who args) (current-continuation-marks)))) ;; keyword searching utility (note: no errors for odd length) diff --git a/collects/mzlib/list.ss b/collects/mzlib/list.ss index f4bd0ce..fbad313 100644 --- a/collects/mzlib/list.ss +++ b/collects/mzlib/list.ss @@ -238,10 +238,8 @@ [(not (pair? l)) (raise (make-exn:fail:contract - (string->immutable-string - (format - "~a: second argument must be a (proper) list; given ~e" - 'name list)) + (format "~a: second argument must be a (proper) list; given ~e" + 'name list) (current-continuation-marks)))] [else (let ([a (car l)]) #,(case (syntax-e #'mode) diff --git a/collects/mzlib/private/sigmatch.ss b/collects/mzlib/private/sigmatch.ss index 784a535..84d0fc4 100644 --- a/collects/mzlib/private/sigmatch.ss +++ b/collects/mzlib/private/sigmatch.ss @@ -46,13 +46,12 @@ (when (eq? v no-val) (raise (make-exn:fail:unit - (string->immutable-string - (format - "~a: ~a is missing a value name `~a', required by ~a" - who - src-context - (sig-path-name s path) - dest-context)) + (format + "~a: ~a is missing a value name `~a', required by ~a" + who + src-context + (sig-path-name s path) + dest-context) (current-continuation-marks)))) (and v (begin @@ -60,14 +59,13 @@ (let ([p (sig-path-name s path)]) (raise (make-exn:fail:unit - (string->immutable-string - (format - "~a: ~a contains `~a' as a sub-unit name, but ~a contains `~a' as a value name" - who - src-context - p - dest-context - p)) + (format + "~a: ~a contains `~a' as a sub-unit name, but ~a contains `~a' as a value name" + who + src-context + p + dest-context + p) (current-continuation-marks))))) (hash-table-put! table s #f) #t)))] @@ -76,13 +74,12 @@ (when (eq? v no-val) (raise (make-exn:fail:unit - (string->immutable-string - (format - "~a: ~a is missing a sub-unit name `~a', required by ~a" - who - src-context - (sig-path-name (car s) path) - dest-context)) + (format + "~a: ~a is missing a sub-unit name `~a', required by ~a" + who + src-context + (sig-path-name (car s) path) + dest-context) (current-continuation-marks)))) (and v (begin @@ -90,14 +87,13 @@ (let ([p (sig-path-name (car s) path)]) (raise (make-exn:fail:unit - (string->immutable-string - (format - "~a: ~a contains `~a' as a value name, but ~a contains `~a' as a sub-unit name" - who - src-context - p - dest-context - p)) + (format + "~a: ~a contains `~a' as a value name, but ~a contains `~a' as a sub-unit name" + who + src-context + p + dest-context + p) (current-continuation-marks))))) (hash-table-put! table (car s) #f) (check-sig-match v (cdr s) (cons (car s) path) @@ -113,14 +109,13 @@ (let ([p (sig-path-name k path)]) (raise (make-exn:fail:unit - (string->immutable-string - (format - "~a: ~a contains an extra ~a name `~a' that is not required by ~a" - who - src-context - (if (symbol? v) 'value 'sub-unit) - p - dest-context)) + (format + "~a: ~a contains an extra ~a name `~a' that is not required by ~a" + who + src-context + (if (symbol? v) 'value 'sub-unit) + p + dest-context) (current-continuation-marks))))))) #t))) diff --git a/collects/mzlib/thread.ss b/collects/mzlib/thread.ss index fa1ad7c..8f717fb 100644 --- a/collects/mzlib/thread.ss +++ b/collects/mzlib/thread.ss @@ -46,9 +46,8 @@ (unless (procedure-arity-includes? f num) (raise (make-exn:fail:contract:arity - (string->immutable-string - (format ": consumer procedure arity is ~e; provided ~s argument~a" - (procedure-arity f) num (if (= 1 num) "" "s"))) + (format ": consumer procedure arity is ~e; provided ~s argument~a" + (procedure-arity f) num (if (= 1 num) "" "s")) (current-continuation-marks))))) (semaphore-wait protect) (set! front-state (cons new-state front-state)) diff --git a/collects/mzlib/unit200.ss b/collects/mzlib/unit200.ss index 0a47334..0479eb7 100644 --- a/collects/mzlib/unit200.ss +++ b/collects/mzlib/unit200.ss @@ -371,17 +371,15 @@ (unless (unit? unit) (raise (make-exn:fail:unit - (string->immutable-string - (format "compound-unit: result of expression for tag ~s not a unit: ~e" tag unit)) + (format "compound-unit: result of expression for tag ~s not a unit: ~e" tag unit) (current-continuation-marks)))) (unless (= num-imports (unit-num-imports unit)) (raise (make-exn:fail:unit - (string->immutable-string - (format "compound-unit: unit for tag ~s expects ~a imports, given ~a" - tag - (unit-num-imports unit) - num-imports)) + (format "compound-unit: unit for tag ~s expects ~a imports, given ~a" + tag + (unit-num-imports unit) + num-imports) (current-continuation-marks)))) (list->vector (map (lambda (ex) @@ -390,9 +388,8 @@ [(null? l) (raise (make-exn:fail:unit - (string->immutable-string - (format "compound-unit: unit for tag ~s has no ~s export" - tag ex)) + (format "compound-unit: unit for tag ~s has no ~s export" + tag ex) (current-continuation-marks)))] [(eq? (car l) ex) i] @@ -757,15 +754,13 @@ (unless (unit? u) (raise (make-exn:fail:unit - (string->immutable-string - (format "invoke-unit: result of unit expression was not a unit: ~e" u)) + (format "invoke-unit: result of unit expression was not a unit: ~e" u) (current-continuation-marks)))) (unless (= (unit-num-imports u) n) (raise (make-exn:fail:unit - (string->immutable-string - (format "invoke-unit: expected a unit with ~a imports, given one with ~a imports" - n (unit-num-imports u))) + (format "invoke-unit: expected a unit with ~a imports, given one with ~a imports" + n (unit-num-imports u)) (current-continuation-marks))))) ;; ---------------------------------------------------------------------- diff --git a/collects/mzlib/unitsig200.ss b/collects/mzlib/unitsig200.ss index 551b0d1..f0a744b 100644 --- a/collects/mzlib/unitsig200.ss +++ b/collects/mzlib/unitsig200.ss @@ -181,10 +181,8 @@ (unless (signed-unit? u) (raise (make-exn - (string->immutable-string - (format - "~s: expression for \"~s\" is not a signed unit: ~e" - who tag u)) + (format "~s: expression for \"~s\" is not a signed unit: ~e" + who tag u) (current-continuation-marks))))) units tags) (for-each @@ -204,10 +202,9 @@ (unless (= c n) (raise (make-exn - (string->immutable-string - (format - "~s: ~a unit imports ~a units, but ~a units were provided" - who tag n c)) + (format + "~s: ~a unit imports ~a units, but ~a units were provided" + who tag n c) (current-continuation-marks)))))) units tags isigs) (for-each diff --git a/collects/net/cookie-unit.ss b/collects/net/cookie-unit.ss index 8b5317e..dd2d5ac 100644 --- a/collects/net/cookie-unit.ss +++ b/collects/net/cookie-unit.ss @@ -64,10 +64,8 @@ ;; constructs a cookie-error struct from the given error message ;; (added to fix exceptions-must-take-immutable-strings bug) (define (error* fmt . args) - (raise - (make-cookie-error - (string->immutable-string (apply format fmt args)) - (current-continuation-marks)))) + (raise (make-cookie-error (apply format fmt args) + (current-continuation-marks)))) ;; The syntax for the Set-Cookie response header is ;; set-cookie = "Set-Cookie:" cookies diff --git a/collects/net/nntp-unit.ss b/collects/net/nntp-unit.ss index aac80a1..e07fa81 100644 --- a/collects/net/nntp-unit.ss +++ b/collects/net/nntp-unit.ss @@ -38,7 +38,7 @@ (define (signal-error constructor format-string . args) (lambda exn-args (raise (apply constructor - (string->immutable-string (apply format format-string args)) + (apply format format-string args) (current-continuation-marks) exn-args)))) diff --git a/collects/net/pop3-unit.ss b/collects/net/pop3-unit.ss index 2e9ce64..d0b754c 100644 --- a/collects/net/pop3-unit.ss +++ b/collects/net/pop3-unit.ss @@ -32,8 +32,7 @@ (define (signal-error constructor format-string . args) (lambda exn-args (raise (apply constructor - (string->immutable-string - (apply format format-string args)) + (apply format format-string args) (current-continuation-marks) exn-args)))) diff --git a/collects/net/url-unit.ss b/collects/net/url-unit.ss index 8b3fc4d..34603a0 100644 --- a/collects/net/url-unit.ss +++ b/collects/net/url-unit.ss @@ -60,12 +60,11 @@ v))))) (define (url-error fmt . args) - (let ([s (string->immutable-string - (apply format fmt - (map (lambda (arg) - (if (url? arg) (url->string arg) arg)) - args)))]) - (raise (make-url-exception s (current-continuation-marks))))) + (raise (make-url-exception + (apply format fmt + (map (lambda (arg) (if (url? arg) (url->string arg) arg)) + args)) + (current-continuation-marks)))) (define (url->string url) (let ([scheme (url-scheme url)]