scm-error-printer resilience
authorAndy Wingo <wingo@pobox.com>
Sun, 27 Feb 2011 22:15:13 +0000 (23:15 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 27 Feb 2011 22:15:13 +0000 (23:15 +0100)
* module/ice-9/boot-9.scm (scm-error-printer): Allow #f for rest args,
  interpreting it as '().  Fixes regexp throws, which are of the form:

    (regular-expression-syntax "make-regexp" "Invalid preceding regular expression" #f ("?.*"))

module/ice-9/boot-9.scm

index 0f89dce..9f621d9 100644 (file)
@@ -538,7 +538,7 @@ If there is no handler at all, Guile prints an error and then exits."
              ((subr msg args . rest)
               (if subr
                   (format port "In procedure ~a: " subr))
-              (apply format port msg args))
+              (apply format port msg (or args '())))
              (_ (default-printer)))
            args))