From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#29684: exception printers - request for improvement Date: Sun, 01 Jul 2018 18:30:16 +0200 Message-ID: <87in5yrk9z.fsf@gnu.org> References: <20171213012435.34d43175@capac> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1530462547 6585 195.159.176.226 (1 Jul 2018 16:29:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2018 16:29:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 29684@debbugs.gnu.org To: David Pirotte Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jul 01 18:29:02 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfDi-0001ZI-3a for guile-bugs@m.gmane.org; Sun, 01 Jul 2018 18:29:02 +0200 Original-Received: from localhost ([::1]:54961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZfFn-0001xe-G2 for guile-bugs@m.gmane.org; Sun, 01 Jul 2018 12:31:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZfFe-0001vK-Rm for bug-guile@gnu.org; Sun, 01 Jul 2018 12:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZfFd-0004Ho-TW for bug-guile@gnu.org; Sun, 01 Jul 2018 12:31:02 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZfFd-0004Hc-OX for bug-guile@gnu.org; Sun, 01 Jul 2018 12:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fZfFd-0008Fj-Ha for bug-guile@gnu.org; Sun, 01 Jul 2018 12:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 01 Jul 2018 16:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29684 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 29684-submit@debbugs.gnu.org id=B29684.153046262631677 (code B ref 29684); Sun, 01 Jul 2018 16:31:01 +0000 Original-Received: (at 29684) by debbugs.gnu.org; 1 Jul 2018 16:30:26 +0000 Original-Received: from localhost ([127.0.0.1]:42278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfF4-0008Eq-GY for submit@debbugs.gnu.org; Sun, 01 Jul 2018 12:30:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZfF2-0008Ed-Ne for 29684@debbugs.gnu.org; Sun, 01 Jul 2018 12:30:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZfEw-0003m5-J0 for 29684@debbugs.gnu.org; Sun, 01 Jul 2018 12:30:19 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZfEw-0003m1-Dm; Sun, 01 Jul 2018 12:30:18 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50362 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZfEv-0002Eq-QU; Sun, 01 Jul 2018 12:30:18 -0400 In-Reply-To: <20171213012435.34d43175@capac> (David Pirotte's message of "Wed, 13 Dec 2017 01:26:33 -0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9082 Archived-At: Hi David, David Pirotte skribis: > +;; instead of using the above, let's define a specific format binding > +;; for exception printers, to allow its user customization. > +(define exception-format simple-format) > + > ;; this is scheme wrapping the C code so the final pred call is a tail c= all, > ;; per SRFI-13 spec > (define string-any > @@ -762,7 +766,7 @@ information is unavailable." > ((not (car args)) 1) > (else 0)))) > (else > - (format (current-error-port) "guile: uncaught throw to ~a: ~a\n" > + (exception-format (current-error-port) "guile: uncaught throw to ~= a: ~a\n" It seems to me that you can achieve similar effect, at least in some cases, by parameterizing =E2=80=98current-error-port=E2=80=99. It also mak= es more sense to me to parameterize =E2=80=98current-error-port=E2=80=99 rather than set =E2=80=98exception-format=E2=80=99, because the =E2=80=98exception-format= =E2=80=99 is very constrained: it has to implement at least everything =E2=80=98simple-format=E2=80=99 imp= lements. WDYT? Besides, note that there=E2=80=99s also =E2=80=98set-exception-printer!=E2= =80=99. It=E2=80=99s a different kind of customization, but it can serve a similar purpose. Thanks, Ludo=E2=80=99.