(format:error): Use 'format:format' instead of
authorMarius Vollmer <mvo@zagadka.de>
Fri, 12 Sep 2003 15:14:25 +0000 (15:14 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Fri, 12 Sep 2003 15:14:25 +0000 (15:14 +0000)
'format' since the latter will lock the mutex again that we have
already locked.
(format:format-work): Flag multiple '#' as an error.

ice-9/format.scm

index 486dc72..5513936 100644 (file)
        (let ((format-string (cadr format-args)))
          (if (not (zero? format:arg-pos))
              (set! format:arg-pos (- format:arg-pos 1)))
-         (format port "~%FORMAT: error with call: (format ~a \"~a<===~a\" ~
+         (format:format
+                 port "~%FORMAT: error with call: (format ~a \"~a<===~a\" ~
                                   ~{~a ~}===>~{~a ~})~%        "
                  (car format:args)
                  (substring format-string 0 format:pos)
                             (string-length format-string))
                  (list-head (cddr format:args) format:arg-pos)
                  (list-tail (cddr format:args) format:arg-pos)))
-       (format port 
-               "~%FORMAT: error with call: (format~{ ~a~})~%        "
-               format:args))
-    (apply format port args)
+       (format:format port 
+                      "~%FORMAT: error with call: (format~{ ~a~})~%        "
+                      format:args))
+    (apply format:format port args)
     (newline port)
     (set! format:error format:error-save)
     (set! format:error-continuation error-continuation)
               (set! param-value-found #t)
               (tilde-dispatch))
              ((#\#)                    ; Parameter is number of remaining args
+              (if param-value-found (format:error "misplaced '#'"))
               (if modifier (format:error "misplaced modifier"))
               (set! params (append params (list (length (rest-args)))))
               (set! param-value-found #t)