unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: guile-user@gnu.org
Subject: Re: How to use ~c with v parameter in (ice-9 format)?
Date: Sun, 10 Nov 2024 16:42:28 -0800	[thread overview]
Message-ID: <38735342-2f32-4859-9df3-93934399c251@gmail.com> (raw)
In-Reply-To: <87bjym64mh.fsf@wolfsden.cz>

On 11/10/24 3:39 PM, Tomas Volf wrote:
> Hello,
>
> when reading the documentation for (ice-9 format), this part of
> description of ~c caught my eye:
>
>> If the charnum parameter is given then an argument is not taken but
>> instead the character is (integer->char charnum) (see
>> Characters). This can be used for instance to output characters given
>> by their ASCII code.
> I wanted to give it a try, so I took the example from documentation and
> run it in a REPL.
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> ,use (ice-9 format)
> scheme@(guile-user)> (format #f "~65c")
> ;;; <stdin>:29:0: warning: "~65c": wrong number of `format' arguments: expected 1, got 0
> $7 = "A"
> --8<---------------cut here---------------end--------------->8---
>
> So, it does indeed return "A", however is also prints a warning.  Am I
> doing something wrong?  Or is the documentation out-dated and `charnum'
> parameter should be used in a different way?
>
> Have a nice day,
> Tomas
>

This looks like a bug in the compiler to me.
For example, check the `format-analysis' procedure in 
language/tree-il/analyze.scm

try this: (apply format #f "~65c" '())

Matt






  parent reply	other threads:[~2024-11-11  0:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-10 23:39 How to use ~c with v parameter in (ice-9 format)? Tomas Volf
2024-11-10 23:57 ` Tomas Volf
2024-11-11  0:42 ` Matt Wette [this message]
2024-11-13 18:37   ` Tomas Volf

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=38735342-2f32-4859-9df3-93934399c251@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user@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).