unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#57226: format seemingly drops arguments when iterating tablature
@ 2022-08-15 10:41 TQ Hirsch
  0 siblings, 0 replies; only message in thread
From: TQ Hirsch @ 2022-08-15 10:41 UTC (permalink / raw)
  To: 57226

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)





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-15 10:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 10:41 bug#57226: format seemingly drops arguments when iterating tablature TQ Hirsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).