GNU bug report logs - #57226
format seemingly drops arguments when iterating tablature

Previous Next

Package: guile;

Reported by: TQ Hirsch <thequux <at> thequux.com>

Date: Mon, 15 Aug 2022 15:46:02 UTC

Severity: normal

To reply to this bug, email your comments to 57226 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#57226; Package guile. (Mon, 15 Aug 2022 15:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to TQ Hirsch <thequux <at> thequux.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Mon, 15 Aug 2022 15:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: TQ Hirsch <thequux <at> thequux.com>
To: bug-guile <at> gnu.org
Subject: format seemingly drops arguments when iterating tablature
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)




This bug report was last modified 1 year and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.