Subject: format seemingly drops arguments when iterating tablature

From: TQ Hirsch <[email-masked]>
Date: Mon, 15 Aug 2022 12:41:41 +0200

I would expect the following expression
    (format #f "~@{~v,0,'-@t,~}" 1 2 3)
to return "-,--,---,", but it instead returns "--,---,"

Further, I would have expected
    (format #f "~{~v,0,'-@t ~}" '(1 2 3))
to have the same results, but i throws an error:

scheme@(guile-user)> (format #f "~{~v,0,'-@t ~}" '(1 2 3))

FORMAT: error with call: (format #f "~{~v,0,'-@t ~}<===" (1 2 3) ===>)
        missing argument(s)
FORMAT: INTERNAL ERROR IN FORMAT-ERROR!
        destination: #f
        format string: "~{~v,0,'-@t ~}"
        format args: ((1 2 3))
        error args:  (#f "error in format" () #f)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error in format

If, however, I include a dummy "0" argument first, I get a (correct)
warning, but also the expected output:

scheme@(guile-user) [1]> (format #f "~{~v,0,'-@t ~}" 0 '(1 2 3))
;;; <unknown-location>: warning: "~{~v,0,'-@t ~}": wrong number of
`format' arguments: expected 1, got 2
$22 = "- -- --- "

This is using Guile 3.0.8, available from Nix as
/nix/store/6lx56ifqh9dznw3mkj2azmh1lmxr617g-guile-3.0.8. (i.e.,
guile_3_0 in a copy of nixpkgs a few days old)