From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 10 23:22:21 2023 Received: (at submit) by debbugs.gnu.org; 11 Nov 2023 04:22:21 +0000 Received: from localhost ([127.0.0.1]:51299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1fVl-0002eo-9g for submit@debbugs.gnu.org; Fri, 10 Nov 2023 23:22:21 -0500 Received: from lists.gnu.org ([2001:470:142::17]:47514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1fVf-0002eX-8a for submit@debbugs.gnu.org; Fri, 10 Nov 2023 23:22:19 -0500 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 1r1fUu-0008Aw-HU for bug-guile@gnu.org; Fri, 10 Nov 2023 23:21:28 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1fUr-0001m2-Lv for bug-guile@gnu.org; Fri, 10 Nov 2023 23:21:28 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id DC2C320003 for ; Sat, 11 Nov 2023 04:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=incana.org; s=gm1; t=1699676480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=9dOWpvlvSwqVep/V9+vUI3ZgiwbW4w9f5e4xUw2q0oA=; b=lrK5L6FGpgbCwhEr1QC3hCKL/MVdd01IwyYlRCF/I/WteSOEUP08FDC+VKEniVowK+eqyk 5z1HwH5hJUyJaeayFkn2N5Ho3haBycyliaUYiW7Wn8XFcErRdaoYtNw40Lp0CDYVlL4BPz l/Vvo4kjiTooemcjVoqdoIgZrMIKaGFHiGfHIevFOtpUB3VHF1KtGTPIdJPbzgIdOWQ+rI 4HfR/oiyQDxlp9Zo8j2MHG86NBTS0WrPvNzDaoYXAu76nuT5d7r4rf7E0fLGbWYvye3Sdk N7bCOxS4QL4BEqCg5LwwQSP1f6NTLB7H6GryLcec49ZPydNFIDJ2hSJtyFJcEQ== Date: Fri, 10 Nov 2023 23:21:09 -0500 From: Juliana Sims Subject: unread-string does not match documented functionality To: bug-guile@gnu.org Message-Id: <9RYX3S.B9ANTOBPFD0W@incana.org> X-Mailer: geary/43.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-GND-Sasl: juli@incana.org Received-SPF: pass client-ip=217.70.183.200; envelope-from=juli@incana.org; helo=relay7-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hello, The procedure unread-string is documented to only optionally accept a port argument, but the implementation in fact requries it. I've written a patch to resolve this and will be sending it along shortly. Thanks, Juli From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 10 23:28:02 2023 Received: (at 67063) by debbugs.gnu.org; 11 Nov 2023 04:28:02 +0000 Received: from localhost ([127.0.0.1]:51310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1fbG-0002nW-9D for submit@debbugs.gnu.org; Fri, 10 Nov 2023 23:28:02 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:51839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1fbE-0002n9-5i for 67063@debbugs.gnu.org; Fri, 10 Nov 2023 23:28:01 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0CC3F60002; Sat, 11 Nov 2023 04:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=incana.org; s=gm1; t=1699676833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MBqOaR+Sje9z9Yr29FqKezxX2iGKgS74Wqg4qXmKubI=; b=l0ZHmdQZRCGfd8aTm1EsSBfvTX9A3/chNKym/7XJNe2FAJBUPk/ujabqoxIIHlgBX37O1s duxSWurO0tkNerW0sO5UT4+reBp2eQgojqDaQIeTg9Iw3v761U2OscPjDwwnM1FdL11cmG U5ibvXAEPGFPBkfY6OfDa3o2Dy9Aeld5lIyCPluwLIWLePu9TZLPFfaPNaUZg0MqEh3G+J aXE1dd7XF/FoMzXwoOiZ5Rr5oprgKaYv+IiHV5SKn9g4OFQXwHUjn6/mtRJqmwV31gUuII 0HeasA35kDKhJtTZapDa8eZuYjqoeiHiagvrcRFeQhQ2jrfKRTHL10yYWoQBeQ== From: Juliana Sims To: bug-guile@gnu.org Subject: [PATCH] Fix unread-string Date: Fri, 10 Nov 2023 23:25:56 -0500 Message-ID: <20231111042639.11663-1-juli@incana.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: juli@incana.org X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 67063 Cc: 67063@debbugs.gnu.org, Juliana Sims X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, This patch simply fixes bug 67063. Thanks, Juli * doc/ref/api-io.texi (Venerable Port Interfaces): Bring unread-string procedure documentation in line with other procedures in the section. * libguile/ports.c (scm_unread_string): Make port argument optional. * test-suite/tests/ports.test: Test unread-char and unread-string without ports. --- doc/ref/api-io.texi | 3 +-- libguile/ports.c | 2 +- test-suite/tests/ports.test | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi index e263e2985..90411fbdf 100644 --- a/doc/ref/api-io.texi +++ b/doc/ref/api-io.texi @@ -1981,8 +1981,7 @@ The same as @code{unget-char}, except that @var{port} defaults to the current input port, and the arguments are swapped. @xref{Textual I/O}. @end deffn -@deffn {Scheme Procedure} unread-string str port -@deffnx {C Function} scm_unread_string (str, port) +@deffn {Scheme Procedure} unread-string str [port] The same as @code{unget-string}, except that @var{port} defaults to the current input port, and the arguments are swapped. @xref{Textual I/O}. @end deffn diff --git a/libguile/ports.c b/libguile/ports.c index c25c20709..eb4a59bd5 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -2228,7 +2228,7 @@ SCM_DEFINE (scm_unread_char, "unread-char", 1, 1, 0, } #undef FUNC_NAME -SCM_DEFINE (scm_unread_string, "unread-string", 2, 0, 0, +SCM_DEFINE (scm_unread_string, "unread-string", 1, 1, 0, (SCM str, SCM port), "Place the string @var{str} in @var{port} so that its characters will be\n" "read in subsequent read operations. If called multiple times, the\n" diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index 1b30e1a68..040bb02f0 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -590,13 +590,13 @@ (with-input-from-string "walk on the moon\nmoon" (lambda () (read-char) - (unread-char #\a (current-input-port)) + (unread-char #\a) (pass-if "unread-char" (char=? (read-char) #\a)) (read-line) (let ((replacenoid "chicken enchilada")) - (unread-char #\newline (current-input-port)) - (unread-string replacenoid (current-input-port)) + (unread-char #\newline) + (unread-string replacenoid) (pass-if "unread-string" (string=? (read-line) replacenoid))) (pass-if "unread residue" -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Mon May 06 05:50:10 2024 Received: (at 67063-done) by debbugs.gnu.org; 6 May 2024 09:50:10 +0000 Received: from localhost ([127.0.0.1]:36910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3uz4-0007Rt-FO for submit@debbugs.gnu.org; Mon, 06 May 2024 05:50:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3uz1-0007Rn-9E for 67063-done@debbugs.gnu.org; Mon, 06 May 2024 05:50:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3uyX-0004R1-FN; Mon, 06 May 2024 05:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=W3IOu7nTZsDLmH2U5Ck0fqPc5s5GEhOiqpiiHMNxwuw=; b=K4SSHYMCk7X7CDBXkX2b 8cEx4IBwXSLCf6N4vVltOJXzd4bRy3jCnPIcyC04Twl5fCpPJigleU5hj9mJAtFszY9GnIh7CY2fr 3OyGtDMFjYJ59V730PVJKITZJgs2kTASnh2XKiykYhELSgRfVHFL98FaqKyRsUUnw1zDgYSyytC2p Op84bFQxrtNSIoC383c058z1TgP0b80jZU7JWaZo+KPs0sqmo6V489Ae3tdvQJfqimFNIb8DqzUYK HnG6VBHbda9yVIxlbugXHBvNZxrKVAgKT4U3sSvwqsAEeh4m7Ar8kURnBi12xgufnxxit8MIR9TVL O0mldA6bwtYqtQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Juliana Sims Subject: Re: bug#67063: unread-string does not match documented functionality In-Reply-To: <20231111042639.11663-1-juli@incana.org> (Juliana Sims's message of "Fri, 10 Nov 2023 23:25:56 -0500") References: <20231111042639.11663-1-juli@incana.org> Date: Mon, 06 May 2024 11:49:34 +0200 Message-ID: <87r0efl175.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67063-done Cc: 67063-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Hi Juliana, Juliana Sims skribis: > This patch simply fixes bug 67063. > > Thanks, > Juli > > * doc/ref/api-io.texi (Venerable Port Interfaces): Bring unread-string > procedure documentation in line with other procedures in the section. > * libguile/ports.c (scm_unread_string): Make port argument optional. > * test-suite/tests/ports.test: Test unread-char and unread-string > without ports. Finally applied with these changes: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/NEWS b/NEWS index 8a61bf65d..3c4854ca9 100644 --- a/NEWS +++ b/NEWS @@ -59,6 +59,8 @@ files. See "Random Access" in the manual for details. () ** 'read-u8' in (scheme base) now defaults to (current-input-port) () +** Second argument of 'unread-string' is now optional, as previously documented + () ** 'ftw' now correctly deals with directory permissions () ** 'make-custom-port' now honors its #:conversion-strategy argument diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi index 3a0f7a9a1..79bc9e9d6 100644 --- a/doc/ref/api-io.texi +++ b/doc/ref/api-io.texi @@ -2001,6 +2001,7 @@ current input port, and the arguments are swapped. @xref{Textual I/O}. @end deffn @deffn {Scheme Procedure} unread-string str [port] +@deffnx {C Function} scm_unread_string (str, port) The same as @code{unget-string}, except that @var{port} defaults to the current input port, and the arguments are swapped. @xref{Textual I/O}. @end deffn --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Not sure why the C functions aren=E2=80=99t documented for the other ones. Thanks, Ludo=E2=80=99. --=-=-=-- From unknown Fri Sep 05 11:52:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 03 Jun 2024 11:24:16 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator