unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: TQ Hirsch <thequux@thequux.com>
To: 57226@debbugs.gnu.org
Subject: bug#57226: format seemingly drops arguments when iterating tablature
Date: Mon, 15 Aug 2022 12:41:41 +0200	[thread overview]
Message-ID: <CALSnc26GZE8cJn25gXrbQ-aVSNJ64A+uTS68C7ytDHNhpWc3RA@mail.gmail.com> (raw)

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)





                 reply	other threads:[~2022-08-15 10:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALSnc26GZE8cJn25gXrbQ-aVSNJ64A+uTS68C7ytDHNhpWc3RA@mail.gmail.com \
    --to=thequux@thequux.com \
    --cc=57226@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).