From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: How to use ~c with v parameter in (ice-9 format)? Date: Sun, 10 Nov 2024 16:42:28 -0800 Message-ID: <38735342-2f32-4859-9df3-93934399c251@gmail.com> References: <87bjym64mh.fsf@wolfsden.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6583"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Nov 11 01:43:24 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tAIWa-0001dG-FW for guile-user@m.gmane-mx.org; Mon, 11 Nov 2024 01:43:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAIVp-0007yJ-Ud; Sun, 10 Nov 2024 19:42:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAIVm-0007xw-Pd for guile-user@gnu.org; Sun, 10 Nov 2024 19:42:35 -0500 Original-Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAIVl-0004iR-8i for guile-user@gnu.org; Sun, 10 Nov 2024 19:42:34 -0500 Original-Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-20c767a9c50so37334685ad.1 for ; Sun, 10 Nov 2024 16:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731285750; x=1731890550; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=+sy8Qfqb0bdVhR04+YBb8J+HNE14xPfxua2e0VfQQhw=; b=m7bok9Pe2HQuVDkvUM8If0L3RhVatxOIiRfMgJwItQ0kFJU+ZAchTAWU/z8KwdM3Mg B4mFcpgb09XDWqG30aQIQAnlTdIPS7SEgcYxoi3DCix3lvZj3EY5nkfcQI+zeDgLWMVF p9kk1T2Dn7VyifYxR/ReVs/nO/bUsDFNh43AMs6q1fQlzl2YgZf6z03kS/0oXR0UeCbF I0zxfS3KHu07J5JJglvOkPiZAcqQPTIOpAQBXrq+PUjdpWJleJ9oHtJnEcOafuQv238i kWmZB3ty3B6QIT+X5ii1+t/qcFbemBhvvcJ7K9SO750ktYuI8r4dEMkkPwt9T1RiN6CR bAwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731285750; x=1731890550; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+sy8Qfqb0bdVhR04+YBb8J+HNE14xPfxua2e0VfQQhw=; b=JQCop1AiJYyQdbI8B0WLoZaZUDqIOBvKGrGtRBNdQmr1ewz2Sjb+elH0KjqJcAijmu 52hgXA0OsJLhiudOAidfdL1NAujQL3k8kljnxP1KONcLOKOFmiULnTigzNOM9q0qizi5 0NdWhmKwEWQuSM+bpRi2aBwt5678t7ck650aVW6d9tpGdwRstofxAeKOuZ0QMelZlrHM 4qMvKkczE7558PKeKeh2IZv6U4ELIeI28M52Foe8mriJjtCJ2Qe/kT4Bny0jm8hTIEMu Y/qC5/t2g2FhPorw8h+0pdj60yCrc1f+u0WFiLaqAmFzyrdYhTmMogvV3kOXlovatd/P eqgw== X-Gm-Message-State: AOJu0YwVHkfa1qXc4SIJck1J3Cax9nlzaWcsMlK5XIPrIVXGSoSsnTuo Zjdfe+SP6QrNfQn5FjmWxCLQtC3hTbb3tt867M41AODhUmJ/viTmbPk1Cw== X-Google-Smtp-Source: AGHT+IGpGYL6vv5deWlo1twzwdf7gFXbtNTV58Y6tWD4AEtQaW2Yt4sIhvhl5iZBTi/6NBkGjk9gjw== X-Received: by 2002:a17:903:2307:b0:20b:6edd:e95a with SMTP id d9443c01a7336-21183c7e015mr161900245ad.3.1731285749997; Sun, 10 Nov 2024 16:42:29 -0800 (PST) Original-Received: from [192.168.2.155] (64-52-138-37.championbroadband.com. [64.52.138.37]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21177dc8c29sm64892265ad.25.2024.11.10.16.42.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Nov 2024 16:42:29 -0800 (PST) Content-Language: en-US In-Reply-To: <87bjym64mh.fsf@wolfsden.cz> Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=matt.wette@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19892 Archived-At: 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") > ;;; :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