unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#20512: bogus warning with (format) and ~{ ~}
@ 2015-05-06  9:16 Daniel Llorens
  2019-09-16 15:06 ` levenson
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Llorens @ 2015-05-06  9:16 UTC (permalink / raw)
  To: 20512


Hello,

this is with current master, I don't know what stable 2.0 does, although I don't think it's changed there.

scheme@(guile-user)> (format #t "~{~{~a~^ ~}\n~}" '((1 2) (3 4)))
;;; <stdin>:1:0: warning: "~{~{~a~^ ~}\\n~}": wrong number of `format' arguments: expected 2, got 1
1 2
3 4
$1 = #t

apparently it only happens with double nesting, e.g. triple nesting is fine:

scheme@(guile-user)> (format #t "~{~{~{~a~^:~}~^ ~}\n~}" '(((1 2) (3 4)) ((5 6) (7 8))))
1:2 3:4
5:6 7:8
$2 = #t

Regards,

	Daniel






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#20512: bogus warning with (format) and ~{ ~}
  2015-05-06  9:16 bug#20512: bogus warning with (format) and ~{ ~} Daniel Llorens
@ 2019-09-16 15:06 ` levenson
  0 siblings, 0 replies; 2+ messages in thread
From: levenson @ 2019-09-16 15:06 UTC (permalink / raw)
  To: 20512


I encounter similar behavior, but for dynamic padding, but it one case
it doesn't even work. I am using guile 2.2.6 from guix distro

scheme@(guile-user)> (format #f "~:{~v_ ~a ~}" '((5 "hello")))

FORMAT: error with call: (format #f "~:{~v_ ~a ~}<===" ((5 hello)) ===>)
        missing argument(s)
In ice-9/format.scm:
  1590:19  2 (format #f "~:{~v_ ~a ~}" ((5 "hello")))
   197:20  1 (format:format-work "~:{~v_ ~a ~}" (((5 "hello"))))
In unknown file:
           0 (scm-error misc-error #f "~A" ("error in format") #f)
error in format

Added the bogus 0 which doesn't do anything

scheme@(guile-user)> (format #f "~:{~v_ ~a ~}" 0 '((5 "hello")))
;;; <stdin>:3:0: warning: "~:{~v_ ~a ~}": wrong number of `format' arguments: expected 1, got 2
$1 = "      hello "


-- 
Alexey





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-16 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06  9:16 bug#20512: bogus warning with (format) and ~{ ~} Daniel Llorens
2019-09-16 15:06 ` levenson

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).