GNU bug report logs - #81238
Couple of SRFI-64 fixes

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Tomas Volf <~@wolfsden.cz>; Done: Olivier Dion <olivier.dion@HIDDEN>; Maintainer for guile is bug-guile@HIDDEN.
bug marked as fixed in version 3.0.12, send any further explanations to 81238 <at> debbugs.gnu.org and Tomas Volf <~@wolfsden.cz> Request was from Olivier Dion <olivier.dion@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Jun 2026 20:18:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 14 16:18:55 2026
Received: from localhost ([127.0.0.1]:34891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1wYrIA-0003D0-09
	for submit <at> debbugs.gnu.org; Sun, 14 Jun 2026 16:18:54 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:46636)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1wYrI2-0003CG-Dm
 for submit <at> debbugs.gnu.org; Sun, 14 Jun 2026 16:18:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1wYrHv-0004ez-3m
 for bug-guile@HIDDEN; Sun, 14 Jun 2026 16:18:35 -0400
Received: from wolfsden.cz ([37.205.8.62])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1wYrHs-00018l-Cx
 for bug-guile@HIDDEN; Sun, 14 Jun 2026 16:18:34 -0400
Received: by wolfsden.cz (Postfix, from userid 104)
 id 65C663F0820; Sun, 14 Jun 2026 20:18:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1781468309; bh=C9x5HkUYcfhZKVtTxgk4OAFHeS92sor1oQC58IuHBGQ=;
 h=From:To:Subject:Date;
 b=MxWRvVU3PmzAHSO8m7h1pijnx23mofLkkhz4EjYppMGL/5GfPuqTObjy9vNjM8U2r
 TXBuFSd3xtH5Cc1MQmI8Ueeu9mlYSJu3sithz9IV1D6M6GtC1b3Pz+sxHsMxPNDIEP
 bP03K5vIqJsz2RZb3jf6cYvo/HT14TECxNSyMT8ZxhWGpU0Dxvp19r+K0EhZTdWuv1
 c+XPzD80I3cEySmjIWiJQqnyCCteNfwiYRoXmBPK5feoJ9rY+FAIMgJi7AigPvhfwh
 gi/keom3P/Hta2DAYOOe2cBS1qCdFSeIj5rBlPtKUq5X7x5TzcI5Shw/h86Hl+2H2R
 aV13TnZprDbwA+Ck6YiMs2aV9ibXgWbtwfH6WwnQ0hqPk4rJg4f5uYsBVuhf/lJh+b
 6+kl+gngm3ahIp34r0WmSTg8RyxFkgjifzNHNJuMGN0svwD2Uz6otrNUTC7rFR8JhO
 vrGepaW8cdcWfgn4pqOmhKlUMpGxmh1OWXEWs8m39FOXRqAMKcaqo3/7VgVtqXVahh
 n0W3Wj1HkUFeP4DQyE/5WX6MIG3SvCdoB4di8Z+cvrekvrNhG8xAkNdqOTaao7qQq9
 rE2LT92HUurFTRKYeSRZl0lP+BaCD0Z5nSi5r1F5ZI4YPEyqjastuNMkK3eB90Hc5X
 WLuuARdmve1NC0QyuYEGdTec=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id 623593F0A9B
 for <bug-guile@HIDDEN>; Sun, 14 Jun 2026 20:18:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1781468308; bh=C9x5HkUYcfhZKVtTxgk4OAFHeS92sor1oQC58IuHBGQ=;
 h=From:To:Subject:Date;
 b=kGSm0pgGufMgzSy/s+fMKQgAIDgQXlw1oRpzdcF/8W9vVbm/HrTzEc0Knw3NVc2IC
 kyu+9X6825QdZauhQ2MFIwoRwN5yk5Rm8hCbebSuUSx1P5ZxT5L6m/4uqQNf4F9YKZ
 IbWlWrNYnZWDt51ky1CMcMFyCQz3WbviIj1EXvC1VF8lxOEcvCXkC7n/NOczggx/pQ
 K5ZjNGaJSA6Dlj+Mqwh9zn20sUj6HzPa/kZaU5LaXel5poj7dIkw2gQAMZBn7P+ioT
 Aqp81H0Ngi3jL2RXsnow455OZeIP6xfuYf/wvwMBhO1Mh242rtlBkvMa0qzsJlweRb
 kkoRHhewMAnzFKZYSSEXVaCwn0I2HvslP16bkim+mhCDVDXU8LzfEhH7yM685Cgb8z
 SFp1RHRUNC/EvfohgS3zBGd6t1MpW/K9ETldF0D27Msa5eBm8KTQhC6X+ipfMujgsi
 PtnhyA7x0bb13qV3JeYR2Z3wBZDHqU6jdg02hxAwAkibjkOh9ckfKvokh7+C/9Pme8
 rG+ve6cYjrBRsmCW223En6brKEBrAKtAiPkwu6Kfn+vNLCB6weCyUK69Uqp0HUaUcD
 8kvaHzYDTriOCVSOf7aJZ9vFTsEIQWGu0/4lqSLfy9bzUxBle/olJUahrFgGu5NI1Y
 /r88NZsYH6csTz3Vf8zLJ4OE=
From: Tomas Volf <~@wolfsden.cz>
To: bug-guile@HIDDEN
Subject: Couple of SRFI-64 fixes
Date: Sun, 14 Jun 2026 22:18:27 +0200
Message-ID: <875x3keuzw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz;
 helo=wolfsden.cz
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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

Hi,

thanks to #199 I was reminded to go through my tree and send couple of
fixes I had lying around for SRFI-64.  You can find them attached.
Consider installing the patches.

Thanks and have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline;
 filename=0001-srfi-64-Fix-maybe-print-prop.patch
Content-Transfer-Encoding: quoted-printable

From 03433ce4d1488d97a9dea6cff4b6c1a066c6f2e4 Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Sun, 10 Nov 2024 23:25:29 +0100
Subject: [PATCH 1/4] srfi-64: Fix maybe-print-prop.

Previously it always printed the property, regardless of whether it was set=
 or
not.

* module/srfi/srfi-64.scm (test-on-test-end-simple)[maybe-print-prop]: Print
only set properties.
---
 module/srfi/srfi-64.scm | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/module/srfi/srfi-64.scm b/module/srfi/srfi-64.scm
index 98fcef645..13ae26d48 100644
--- a/module/srfi/srfi-64.scm
+++ b/module/srfi/srfi-64.scm
@@ -418,15 +418,16 @@ instead."
 (define (test-on-test-end-simple runner)
   "Log that test is done."
   (define (maybe-print-prop prop pretty?)
-    (let* ((val (test-result-ref runner prop))
-           (val (string-trim-both
-                 (with-output-to-string
-                   (=CE=BB ()
-                     (if pretty?
-                         (pretty-print val #:per-line-prefix "            =
 ")
-                         (display val)))))))
-      (when val
-        (format #t "~a: ~a~%" prop val))))
+    (let* ((default (list))
+           (val (test-result-ref runner prop default)))
+      (unless (eq? val default)
+        (let ((val (string-trim-both
+                    (with-output-to-string
+                      (=CE=BB ()
+                        (if pretty?
+                            (pretty-print val #:per-line-prefix "         =
    ")
+                            (display val)))))))
+          (format #t "~a: ~a~%" prop val)))))
=20
   (let ((result-kind (test-result-kind runner)))
     ;; Skip tests not executed due to run list.
--=20
2.54.0


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline;
 filename=0002-srfi-64-Use-s-when-printing-some-properties.patch
Content-Transfer-Encoding: quoted-printable

From a2c8f8fdc406fd06552583fd7e5429d66b43d2ab Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Mon, 11 Nov 2024 00:46:45 +0100
Subject: [PATCH 2/4] srfi-64: Use ~s when printing some properties.

This will help to properly debug failing tests like:

    (test-equal "some failing test" "a b " "a b")

Before there was no way to tell that one "a b" as extra trailing space, now
there is.

* module/srfi/srfi-64.scm (test-on-test-end-simple)['expected-value]
['expected-error, 'actual-value, 'actual-error]: Print using ~s.
[maybe-print-prop]: Take the code for format as a parameter.
---
 module/srfi/srfi-64.scm | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/module/srfi/srfi-64.scm b/module/srfi/srfi-64.scm
index 13ae26d48..7b3341bf0 100644
--- a/module/srfi/srfi-64.scm
+++ b/module/srfi/srfi-64.scm
@@ -27,7 +27,6 @@
   #:use-module (ice-9 exceptions)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
-  #:use-module (ice-9 pretty-print)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-26)
@@ -417,17 +416,11 @@ instead."
=20
 (define (test-on-test-end-simple runner)
   "Log that test is done."
-  (define (maybe-print-prop prop pretty?)
+  (define (maybe-print-prop prop pretty? code)
     (let* ((default (list))
            (val (test-result-ref runner prop default)))
       (unless (eq? val default)
-        (let ((val (string-trim-both
-                    (with-output-to-string
-                      (=CE=BB ()
-                        (if pretty?
-                            (pretty-print val #:per-line-prefix "         =
    ")
-                            (display val)))))))
-          (format #t "~a: ~a~%" prop val)))))
+        (format #t "~a: ~@?~&" prop code val))))
=20
   (let ((result-kind (test-result-kind runner)))
     ;; Skip tests not executed due to run list.
@@ -436,13 +429,13 @@ instead."
               result-kind
               (test-runner-test-name runner))
       (unless (member result-kind '(pass xfail))
-        (maybe-print-prop 'source-file    #f)
-        (maybe-print-prop 'source-line    #f)
-        (maybe-print-prop 'source-form    #t)
-        (maybe-print-prop 'expected-value #f)
-        (maybe-print-prop 'expected-error #t)
-        (maybe-print-prop 'actual-value   #f)
-        (maybe-print-prop 'actual-error   #t)))))
+        (maybe-print-prop 'source-file    #f "~a")
+        (maybe-print-prop 'source-line    #f "~a")
+        (maybe-print-prop 'source-form    #t "~y")
+        (maybe-print-prop 'expected-value #f "~s")
+        (maybe-print-prop 'expected-error #t "~s")
+        (maybe-print-prop 'actual-value   #f "~s")
+        (maybe-print-prop 'actual-error   #t "~s")))))
=20
 (define (test-runner-simple)
   "Creates a new simple test-runner, that prints errors and a summary on t=
he
--=20
2.54.0


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline;
 filename=0003-srfi-64-Export-define-equality-test.patch
Content-Transfer-Encoding: quoted-printable

From 99205d86ab6b2bb3b428ece28517f0427befeb78 Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Fri, 15 Nov 2024 22:26:57 +0100
Subject: [PATCH 3/4] srfi-64: Export define-equality-test.

Interest was expressed on the mailing list to have %test-2 as a part of the
public API.  So rename it and export from the module.

* module/srfi/srfi-64.scm (define-equality-test): Rename from %test-2.
(%test-2): Rename from %%test-2.
(test-eq, test-eqv, test-equal): Adjust.
(define-module)<#:export>: Export it.
---
 module/srfi/srfi-64.scm | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/module/srfi/srfi-64.scm b/module/srfi/srfi-64.scm
index 7b3341bf0..203db49ea 100644
--- a/module/srfi/srfi-64.scm
+++ b/module/srfi/srfi-64.scm
@@ -118,6 +118,8 @@
    test-procedure?
    test-thunk
=20
+   define-equality-test
+
    &bad-end-name
    bad-end-name?
    bad-end-name-begin-name
@@ -728,7 +730,7 @@ to invoke @code{test-assert} if there is no current tes=
t runner.
=20
 @end defspec")
=20
-(define-syntax %%test-2
+(define-syntax %test-2
   (=CE=BB (x)
     (syntax-case x ()
       ((_ syn test-proc test-name expected test-expr)
@@ -742,20 +744,34 @@ to invoke @code{test-assert} if there is no current t=
est runner.
                          (test-result-set! r 'actual-value   a)
                          (test-proc e a))))))))
=20
-(define-syntax %test-2
+(define-syntax define-equality-test
   (syntax-rules ()
     ((_ name test-proc)
      (define-syntax name
        (=CE=BB (x)
          (syntax-case x ()
            ((_ test-name expected test-expr)
-            #`(%%test-2 #,x test-proc test-name expected test-expr))
+            #`(%test-2 #,x test-proc test-name expected test-expr))
            ((_ expected test-expr)
-            #`(%%test-2 #,x test-proc #f        expected test-expr))))))))
+            #`(%test-2 #,x test-proc #f        expected test-expr))))))))
+(set-documentation! 'define-equality-test
+  "@defspec define-equality-test identifier proc
+Define a new test form named @var{identifier} with same signature and usag=
e as
+@code{test-eq} but using @var{proc} instead of @code{eq?}.
=20
-(%test-2 test-eq    eq?)
-(%test-2 test-eqv   eqv?)
-(%test-2 test-equal equal?)
+For example, the provided equality checks are defined as:
+
+@lisp
+(define-equality-test test-eq    eq?)
+(define-equality-test test-eqv   eqv?)
+(define-equality-test test-equal equal?)
+@end lisp
+
+@end defspec")
+
+(define-equality-test test-eq    eq?)
+(define-equality-test test-eqv   eqv?)
+(define-equality-test test-equal equal?)
=20
 (set-documentation! 'test-eq
   "@defspec test-eq test-name expected test-expr
--=20
2.54.0


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0004-srfi-64-Report-failed-tests-in-standards-Errors-form.patch

From 7720c0c735688850b6fefef063260220abaed994 Mon Sep 17 00:00:00 2001
From: Tomas Volf <~@wolfsden.cz>
Date: Sat, 16 Nov 2024 18:19:45 +0100
Subject: [PATCH 4/4] srfi-64: Report failed tests in (standards)Errors format.

There is a page in the GNU Standards document regarding the format of error
messages.  Both GNU Emacs and Vim are able to parse it and support jumping to
next/previous error.  My version did not produce a line in this format for
failed tests and this commit rectifies that.

* module/srfi/srfi-64.scm (test-on-test-end-simple)[non-passed]: Write
out (standards)Errors compatible line.
---
 module/srfi/srfi-64.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/module/srfi/srfi-64.scm b/module/srfi/srfi-64.scm
index 203db49ea..98f6c8114 100644
--- a/module/srfi/srfi-64.scm
+++ b/module/srfi/srfi-64.scm
@@ -28,6 +28,7 @@
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-71)
@@ -431,6 +432,10 @@ instead."
               result-kind
               (test-runner-test-name runner))
       (unless (member result-kind '(pass xfail))
+        (and-let* ((file (test-result-ref runner 'source-file))
+                   (line (test-result-ref runner 'source-line)))
+          ;; Satisfy (standards)Errors
+          (format #t "~a:~a: unexpected result~%" file line))
         (maybe-print-prop 'source-file    #f "~a")
         (maybe-print-prop 'source-line    #f "~a")
         (maybe-print-prop 'source-form    #t "~y")
-- 
2.54.0


--=-=-=--




Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#81238; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 Jul 2026 19:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.