bug#57226: format seemingly drops arguments when iterating tablature

TQ Hirsch <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <CALSnc26GZE8cJn25gXrbQ-aVSNJ64A+uTS68C7ytDHNhpWc3RA@mail.gmail.com>
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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.