From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.lisp.guile.bugs Subject: bug#62464: [PATCH] error-object-irritants may #f instead of a list Date: Sun, 26 Mar 2023 18:48:48 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="858w9tY8w5qbne5R" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10285"; mail-complaints-to="usenet@ciao.gmane.io" To: 62464@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun Mar 26 18:50:31 2023 Return-path: Envelope-to: guile-bugs@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 1pgTZd-0002OC-JT for guile-bugs@m.gmane-mx.org; Sun, 26 Mar 2023 18:50:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgTZN-0003OO-0m; Sun, 26 Mar 2023 12:50:13 -0400 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 1pgTZK-0003Nj-LQ for bug-guile@gnu.org; Sun, 26 Mar 2023 12:50:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pgTZC-000639-RB for bug-guile@gnu.org; Sun, 26 Mar 2023 12:50:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgTZC-0000O5-5A for bug-guile@gnu.org; Sun, 26 Mar 2023 12:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 26 Mar 2023 16:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62464 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16798493421404 (code B ref -1); Sun, 26 Mar 2023 16:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Mar 2023 16:49:02 +0000 Original-Received: from localhost ([127.0.0.1]:45737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgTYD-0000MT-KW for submit@debbugs.gnu.org; Sun, 26 Mar 2023 12:49:01 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgTYB-0000MJ-AI for submit@debbugs.gnu.org; Sun, 26 Mar 2023 12:49:00 -0400 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 1pgTYA-0003GX-TA for bug-guile@gnu.org; Sun, 26 Mar 2023 12:48:58 -0400 Original-Received: from mout-p-102.mailbox.org ([80.241.56.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pgTY8-0004rW-Lq for bug-guile@gnu.org; Sun, 26 Mar 2023 12:48:58 -0400 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Pl22n4yYQz9sS6 for ; Sun, 26 Mar 2023 18:48:49 +0200 (CEST) Content-Disposition: inline X-Rspamd-Queue-Id: 4Pl22n4yYQz9sS6 Received-SPF: pass client-ip=80.241.56.152; envelope-from=mail@vasilij.de; helo=mout-p-102.mailbox.org X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10577 Archived-At: --858w9tY8w5qbne5R Content-Type: multipart/mixed; boundary="kR0ebNmyVrHAHpmN" Content-Disposition: inline --kR0ebNmyVrHAHpmN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hello, I've tried to run a R7RS program and ran into an error with the `error-object-irritants` procedure. According to R7RS-small, it returns a list of irritants for the error object, but under Guile it returns #f instead of an empty list. This behavior deviates from other R7RS implementations I've tested the program against. I've attached both a reproduction script (invoke with `guile -q --r7rs -s test.scm`) and a patch that resolves the issue. Guile version: 3.0.9 Machine type: x86_64-pc-linux-gnu Operating system: Arch Linux OS package version: `pacman -Q guile`: guile 3.0.9-1 --kR0ebNmyVrHAHpmN Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="test.scm" (define-library (test) (import (scheme base)) (import (scheme write)) (begin (guard (ex ((error-object? ex) (display "[error] ") (display (error-object-message ex)) (newline) (display "[irritants]") (newline) (for-each (lambda (irritant) (display irritant) (newline)) (error-object-irritants ex)))) (error "An error without irritants")))) --kR0ebNmyVrHAHpmN Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-Make-error-object-irritants-always-returns-a-list.patch" Content-Transfer-Encoding: quoted-printable =46rom 923e677084733e8b077ab31cb625acf8f6ecdf55 Mon Sep 17 00:00:00 2001 =46rom: Vasilij Schneidermann Date: Sun, 26 Mar 2023 18:16:23 +0200 Subject: [PATCH] Make error-object-irritants always returns a list Per R7RS-small, the procedure is defined to return "a list of the irritants encapsulated by error-object", but currently it returns #f if there are no irritants. This has been fixed now. * module/scheme/base.scm (error-object-irritants): Improve R7RS compliance by always returning a list of irritants. --- module/scheme/base.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/scheme/base.scm b/module/scheme/base.scm index c6a73c092..eea2401b2 100644 --- a/module/scheme/base.scm +++ b/module/scheme/base.scm @@ -260,8 +260,9 @@ (exception-message obj))) =20 (define (error-object-irritants obj) - (and (exception-with-irritants? obj) - (exception-irritants obj))) + (if (exception-with-irritants? obj) + (exception-irritants obj) + '())) =20 (define (r7:error message . irritants) (raise-exception --=20 2.40.0 --kR0ebNmyVrHAHpmN-- --858w9tY8w5qbne5R Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEE0dAcySl3bqM8O17WFmfJg6zCifoFAmQgd20ACgkQFmfJg6zC ifqraAgAmjowUF6lIy4u4JM1QpDCN1es0L2ZhDRFEBwMksL5c1IufP+muBqN+isf A8IThQfTQ+WPFDTGylknzhaI4CJ4VA3us7RuKXHGcTdricfYWAG981bG88NYF5N8 oDHR+kenIJAQASMO/KOaT/shzU4I4XqAyDT6/mIzCPYG2txl+0s8JQsI0l/FJMkp dXxgtr8Eupa3Fcyhsuwtqz17aQTjJn+G1O4pzDzVNmUjtVj5iTkSmLyW6ug3aA8W XaKa4EEG7dlknRnFm1bcetqmjMVLHJNZnF6fTY9NRYGXz8XdvfrxlCKSPwghJRqf yAn7ntp5sv5QNpLStgyDfAjr/mRy8A== =D8ON -----END PGP SIGNATURE----- --858w9tY8w5qbne5R--