GNU logs - #29684, boring messages


Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Wed, 13 Dec 2017 03:28:02 +0000
Resent-Message-ID: <handler.29684.B.15131356258794 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: 29684 <at> debbugs.gnu.org
X-Debbugs-Original-To: <bug-guile@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.15131356258794
          (code B ref -1); Wed, 13 Dec 2017 03:28:02 +0000
Received: (at submit) by debbugs.gnu.org; 13 Dec 2017 03:27:05 +0000
Received: from localhost ([127.0.0.1]:59227 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eOxhI-0002Hm-Kd
	for submit <at> debbugs.gnu.org; Tue, 12 Dec 2017 22:27:04 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46574)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1eOxhG-0002HF-Ox
 for submit <at> debbugs.gnu.org; Tue, 12 Dec 2017 22:27:03 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1eOxh9-0004Ib-Vb
 for submit <at> debbugs.gnu.org; Tue, 12 Dec 2017 22:26:57 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:35076)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <david@HIDDEN>) id 1eOxh9-0004IV-RC
 for submit <at> debbugs.gnu.org; Tue, 12 Dec 2017 22:26:55 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37530)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1eOxh8-0000Kg-22
 for bug-guile@HIDDEN; Tue, 12 Dec 2017 22:26:55 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1eOxh3-0004GQ-3J
 for bug-guile@HIDDEN; Tue, 12 Dec 2017 22:26:54 -0500
Received: from maximusconfessor.all2all.org ([79.99.200.102]:33960)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <david@HIDDEN>) id 1eOxh2-0004G8-Nj
 for bug-guile@HIDDEN; Tue, 12 Dec 2017 22:26:49 -0500
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 8278BA04C1BC
 for <bug-guile@HIDDEN>; Wed, 13 Dec 2017 04:26:47 +0100 (CET)
Received: from maximusconfessor.all2all.org ([192.168.0.1])
 by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new,
 port 10024) with ESMTP id vOaprWLFPSJN for <bug-guile@HIDDEN>;
 Wed, 13 Dec 2017 04:26:43 +0100 (CET)
Received: from capac (unknown [179.210.16.171])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 4A6AEA04C1B9
 for <bug-guile@HIDDEN>; Wed, 13 Dec 2017 04:26:42 +0100 (CET)
Date: Wed, 13 Dec 2017 01:26:33 -0200
From: David Pirotte <david@HIDDEN>
Message-ID: <20171213012435.34d43175@capac>
X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 boundary="Sig_/C6XpQvcB=C2fh9ZKEDbL5EQ"; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
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: -5.0 (-----)

--Sig_/C6XpQvcB=C2fh9ZKEDbL5EQ
Content-Type: multipart/mixed; boundary="MP_/SfZDFOGZvgBhiXJsATPDlJ/"

--MP_/SfZDFOGZvgBhiXJsATPDlJ/
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello,

	The attached patched is from Daniel Lloren, I'm just 'a messenger' (and ad=
ded
	a comment in the source, preceding the new binding).

The proposed patch is to allow  exception printers user customization.

This has been very important, not to say vital, for those of us who manipul=
ate large
structures, lists, arrays, sfri-4 bytevectors, ..., something we have been =
doing
locally ... but we need something for our users (aiscm, guile-cv ...), so t=
hey don't
have to patch guile locally... (most would be scared to do so and would not=
 do it
anyway...).

Once applied, users can, for example, customize the raised exception system=
 so it
uses truncated-print, either individually (in .guile), or guile admins can =
do
this globally (in share/guile-site/init.scm):

	(use-modules (ice-9 pretty-print))
                   =20
	(when (defined? 'exception-format)
	  (set! exception-format
	        (lambda (port fmt . args)
	          (for-each (lambda (arg)
	                      (truncated-print arg #:port port))
	              args))))

Maybe there is another/better approach, I don't know, but this works pretty=
 well
for me...

Thanks,
David

--MP_/SfZDFOGZvgBhiXJsATPDlJ/
Content-Type: text/x-patch
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename=0002-Allowing-exception-printers-user-customization.patch

=46rom 772cc05b1fe481a43be4c17c90ed3788cf37d2a6 Mon Sep 17 00:00:00 2001
From: David Pirotte <david@HIDDEN>
Date: Wed, 13 Dec 2017 00:43:30 -0200
Subject: [PATCH 2/2] Allowing exception printers user customization

* module/ice-9/boot-9.scm (exception-format, dispatch-exception,
  exception-printers, scm-error-printer, syntax-error-printer,
  keyword-error-printer, getaddrinfo-error-printer, false-if-exception,
  make-record-type):  Instead of using 'format', let's define a specific
  format binding for exception printers, to allow its user
  customization.
---
 module/ice-9/boot-9.scm | 46 ++++++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 751a3bcd1..cbbedac15 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -326,6 +326,10 @@ If returning early, return the return value of F."
=20
 (define format simple-format)
=20
+;; 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 cal=
l,
 ;; 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"
               key args)
       (primitive-exit 1))))
=20
@@ -865,8 +869,8 @@ for key @var{k}, then invoke @var{thunk}."
           (let ((filename (or (cadr source) "<unnamed port>"))
                 (line (caddr source))
                 (col (cdddr source)))
-            (format port "~a:~a:~a: " filename (1+ line) col))
-          (format port "ERROR: "))))
+            (exception-format port "~a:~a:~a: " filename (1+ line) col))
+          (exception-format port "ERROR: "))))
=20
   (set! set-exception-printer!
         (lambda (key proc)
@@ -875,7 +879,7 @@ for key @var{k}, then invoke @var{thunk}."
   (set! print-exception
         (lambda (port frame key args)
           (define (default-printer)
-            (format port "Throw to key `~a' with args `~s'." key args))
+            (exception-format port "Throw to key `~a' with args `~s'." key=
 args))
=20
           (when frame
             (print-location frame port)
@@ -884,7 +888,7 @@ for key @var{k}, then invoke @var{thunk}."
                           (lambda () (frame-procedure-name frame))
                           (lambda _ #f))))
               (when name
-                (format port "In procedure ~a:\n" name))))
+                (exception-format port "In procedure ~a:\n" name))))
=20
           (catch #t
             (lambda ()
@@ -893,7 +897,9 @@ for key @var{k}, then invoke @var{thunk}."
                     (printer port key args default-printer)
                     (default-printer))))
             (lambda (k . args)
-              (format port "Error while printing exception.")))
+              (exception-format
+               port "Error while printing exception `~a`: `~a' with args [=
~s]"
+               key k args)))
           (newline port)
           (force-output port))))
=20
@@ -907,38 +913,38 @@ for key @var{k}, then invoke @var{thunk}."
     (apply (case-lambda
              ((subr msg args . rest)
               (if subr
-                  (format port "In procedure ~a: " subr))
-              (apply format port msg (or args '())))
+                  (exception-format port "In procedure ~a: " subr))
+              (apply exception-format port msg (or args '())))
              (_ (default-printer)))
            args))
=20
   (define (syntax-error-printer port key args default-printer)
     (apply (case-lambda
              ((who what where form subform . extra)
-              (format port "Syntax error:\n")
+              (exception-format port "Syntax error:\n")
               (if where
                   (let ((file (or (assq-ref where 'filename) "unknown file=
"))
                         (line (and=3D> (assq-ref where 'line) 1+))
                         (col (assq-ref where 'column)))
-                    (format port "~a:~a:~a: " file line col))
-                  (format port "unknown location: "))
+                    (exception-format port "~a:~a:~a: " file line col))
+                  (exception-format port "unknown location: "))
               (if who
-                  (format port "~a: " who))
-              (format port "~a" what)
+                  (exception-format port "~a: " who))
+              (exception-format port "~a" what)
               (if subform
-                  (format port " in subform ~s of ~s" subform form)
+                  (exception-format port " in subform ~s of ~s" subform fo=
rm)
                   (if form
-                      (format port " in form ~s" form))))
+                      (exception-format port " in form ~s" form))))
              (_ (default-printer)))
            args))
=20
   (define (keyword-error-printer port key args default-printer)
     (let ((message (cadr args))
           (faulty  (car (cadddr args)))) ; I won't do it again, I promise.
-      (format port "~a: ~s" message faulty)))
+      (exception-format port "~a: ~s" message faulty)))
=20
   (define (getaddrinfo-error-printer port key args default-printer)
-    (format port "In procedure getaddrinfo: ~a" (gai-strerror (car args))))
+    (exception-format port "In procedure getaddrinfo: ~a" (gai-strerror (c=
ar args))))
=20
   (set-exception-printer! 'goops-error scm-error-printer)
   (set-exception-printer! 'host-not-found scm-error-printer)
@@ -1066,11 +1072,11 @@ VALUE."
        (lambda (key . args)
          (for-each (lambda (s)
                      (if (not (string-null? s))
-                         (format (current-warning-port) ";;; ~a\n" s)))
+                         (exception-format (current-warning-port) ";;; ~a\=
n" s)))
                    (string-split
                     (call-with-output-string
                      (lambda (port)
-                       (format port template arg ...)
+                       (exception-format port template arg ...)
                        (print-exception port #f key args)))
                     #\newline))
          #f)))))
@@ -1229,7 +1235,7 @@ VALUE."
                 (if (=3D (length args) nfields)
                     (apply make-struct/no-tail rtd args)
                     (scm-error 'wrong-number-of-args
-                               (format #f "make-~a" type-name)
+                               (exception-format #f "make-~a" type-name)
                                "Wrong number of arguments" '() #f)))))))))
=20
   (define (default-record-printer s p)
--=20
2.15.1


--MP_/SfZDFOGZvgBhiXJsATPDlJ/--

--Sig_/C6XpQvcB=C2fh9ZKEDbL5EQ
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAlownekACgkQ83T9k6MF
etc5pQgArOlyZXGyAOfDTVbmYi5rcIc7QlinvSHys68A8N1vhSGGP7u7jH7rIihT
vttfzF/qdG8NrJ7OXQWM3xfw+xWMmQkChL2i60Ux5xfpYT3IPFZDu1gXi/Cc2qOn
nC7HnONwx8x/qqyjOmallPOhlDHNTC2z4R45qtF0Fp16m0o6Re2xt2fLscTB38Vo
FAj4TR6rWnWOcqP78pbDeMmRnhi3A8LN2ZKnhAWnDv5TmpAbKwq+wZLNCTgPdDhw
cInss/VqId8wy0ig69JZulhPz3cD67Lf4EeEmg4MQ80hmkmTM1BY9f/XLd4kMHKW
ixAgWx0AXFr/qkVc5aHQCuhHrlOGlA==
=bqjF
-----END PGP SIGNATURE-----

--Sig_/C6XpQvcB=C2fh9ZKEDbL5EQ--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: David Pirotte <david@HIDDEN>
Subject: bug#29684: Acknowledgement (exception printers - request for
 improvement)
Message-ID: <handler.29684.B.15131356258794.ack <at> debbugs.gnu.org>
References: <20171213012435.34d43175@capac>
X-Gnu-PR-Message: ack 29684
X-Gnu-PR-Package: guile
Reply-To: 29684 <at> debbugs.gnu.org
Date: Wed, 13 Dec 2017 03:28:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-guile@HIDDEN

If you wish to submit further information on this problem, please
send it to 29684 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
29684: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D29684
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: Daniel Llorens <daniel.llorens@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Thu, 14 Dec 2017 14:39:02 +0000
Resent-Message-ID: <handler.29684.B29684.151326231320967 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: 29684 <at> debbugs.gnu.org
Cc: David Pirotte <david@HIDDEN>
Received: via spool by 29684-submit <at> debbugs.gnu.org id=B29684.151326231320967
          (code B ref 29684); Thu, 14 Dec 2017 14:39:02 +0000
Received: (at 29684) by debbugs.gnu.org; 14 Dec 2017 14:38:33 +0000
Received: from localhost ([127.0.0.1]:33149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ePUed-0005S5-7C
	for submit <at> debbugs.gnu.org; Thu, 14 Dec 2017 09:38:31 -0500
Received: from vimdzmsp-sfwd04.bluewin.ch ([195.186.227.132]:33316
 helo=smtpauths.lb.bluewin.ch)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <daniel.llorens@HIDDEN>) id 1ePUeY-0005Rk-H9
 for 29684 <at> debbugs.gnu.org; Thu, 14 Dec 2017 09:38:27 -0500
Received: from [10.42.0.160] ([213.193.80.99])
 by vimdzmsp-sfwd04.bluewin.ch Swisscom AG with SMTP
 id PUeReUq5lEMC4PUeSehNMx; Thu, 14 Dec 2017 15:38:20 +0100
X-Bluewin-Spam-Analysis: v=2.1 cv=R6vOYYlX c=1 sm=1 tr=0
 a=DzaHVtLsrNCQ5PccsnG91A==:117 a=DzaHVtLsrNCQ5PccsnG91A==:17
 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=mDV3o1hIAAAA:8
 a=r3sLHcF3gtLLsd-G3P8A:9 a=pILNOxqGKmIA:10 a=GAgZYncLulQA:10
 a=FWqoJnpfysoA:10 a=xX9s1JTShJ8A:10 a=oo02T4f9SFw6BvWe:21 a=_W_S_7VecoQA:10
 a=_FVE-zBwftR9WsbkzFJk:22
X-Bluewin-Spam-Score: 0.00
X-FXIT-IP: IPv4[213.193.80.99] Epoch[1513262300]
X-Bluewin-AuthAs: dll@HIDDEN
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_FA577E85-4A48-4D93-B0A0-81A700BF3CF0"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Daniel Llorens <daniel.llorens@HIDDEN>
In-Reply-To: <mailman.20.1513184404.6520.bug-guile@HIDDEN>
Date: Thu, 14 Dec 2017 15:38:18 +0100
Message-Id: <75FC7864-12FB-4C11-A154-409A596FEB17@HIDDEN>
References: <mailman.20.1513184404.6520.bug-guile@HIDDEN>
X-Mailer: Apple Mail (2.1878.6)
X-CMAE-Envelope: MS4wfEYXdTYa5mzsyAFG5n8G+fKNpL/FynyA/duCvlTATMhx1/kqNkZb0ovLFbSXcyEIMJKjh+eyIAbx6sWxlpnBCwgbnqMhA4F4FH2y1lhO7/7dWyLq7mVd
 Se3/HUv2Ag79t8V+Uy8dtZtvYLqIaLCutnKM3js3V2tup51fGKQ5SCxIjLk/mCPKQD2y4y2oLqdT+OqoascKvFXKIOFRhrgPnM0=
X-Spam-Score: -0.7 (/)
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.7 (/)


--Apple-Mail=_FA577E85-4A48-4D93-B0A0-81A700BF3CF0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


Agreed with David that this is an important issue. Without a patch, =
working with a large data structure is guaranteed to kill the REPL =
session sooner or later. There was a thread a while ago here: =
https://lists.gnu.org/archive/html/guile-user/2017-02/msg00188.html

Right now, the REPL will catch either general exceptions or calls to =
error or scm-error which throw specific exception types. For general =
exceptions the argument list is just printed with ~a, but for libguile =
exceptions, the handler expects a =91format=92 argument which is used to =
format the error message. One can put ~a and ~s in this =91format=92 =
argument, see =
https://www.gnu.org/software/guile/manual/html_node/Handling-Errors.html.

The proposal

> 	(use-modules (ice-9 pretty-print))
>=20
> 	(when (defined? 'exception-format)
> 	  (set! exception-format
> 	        (lambda (port fmt . args)
> 	          (for-each (lambda (arg)
> 	                      (truncated-print arg #:port port))
> 	              args))))

throws away this formatting. That's why I proposed instead the other =
solution in the links above, which replaces the ~a and ~s by ~y (this =
calls truncated print), but otherwise respects the original format =
string.

(set! exception-format
         (lambda (port fmt . args)
           (apply format port (rewrite-fmt (rewrite-fmt fmt "~s") "~a") =
args)))

Anyway. These are clunky hacks. According to the manual

> ~A indicates an argument printed using display, while ~S indicates an =
argument printed using write


I think this is an unnecessary complication if there's a hook. One =
option (that works like =91write=92 by default) is enough. If one wants =
to craft a special error message, that should be done without abusing =
the exception arguments.

I think this =91write=92 should be a hook or even a fluid. There is =
already a hook to configure the REPL printer, which is set by =
(repl-default-option-set! 'print ##) or (repl-option-set! repl 'print =
##) (the latter is undocumented). Maybe that hook can be reused for the =
exception printer. Or maybe there can be a new hook that is reused by =
both the repl and the exception printer. It makes sense to me to make =
both of these refer to the same function.

I also agree with David that both the REPL and the exception printers =
should be truncated by default. That requires truncated-print to be =
available in (ice-9 boot).

Anyway, just some thoughts.

See the related bug#29669 about REPL printers.=20

Regards

	Daniel=

--Apple-Mail=_FA577E85-4A48-4D93-B0A0-81A700BF3CF0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=windows-1252

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><div><br></div><div>Agreed with David that this is =
an important issue. Without a patch, working with a large data structure =
is guaranteed to kill the REPL session sooner or later.&nbsp;<span =
style=3D"font-family: IowanOldStyle-Roman;">There was a thread a while =
ago here:&nbsp;</span><a =
href=3D"https://lists.gnu.org/archive/html/guile-user/2017-02/msg00188.htm=
l">https://lists.gnu.org/archive/html/guile-user/2017-02/msg00188.html</a>=
</div><div><br></div><div>Right now, the REPL will catch either general =
exceptions or calls to error or scm-error which throw specific exception =
types. For general exceptions the argument list is just printed with ~a, =
but for libguile exceptions, the handler expects a =91format=92 argument =
which is used to format the error message. One can put ~a and ~s in this =
=91format=92 argument, see <a =
href=3D"https://www.gnu.org/software/guile/manual/html_node/Handling-Error=
s.html">https://www.gnu.org/software/guile/manual/html_node/Handling-Error=
s.html</a>.</div><div><br></div><div>The =
proposal</div><div><br></div><div><blockquote type=3D"cite"><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>(use-modules (ice-9 pretty-print))<br><br><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>(when =
(defined? 'exception-format)<br><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span> &nbsp;(set! =
exception-format<br><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(lambda (port fmt . =
args)<br><span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(for-each =
(lambda (arg)<br><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
	</span> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(truncated-print arg =
#:port port))<br><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
	</span> =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;args))))<br></blockquote><div><br></div><div>throws away this =
formatting. That's why I proposed instead the other solution in the =
links above, which replaces the ~a and ~s by ~y (this calls truncated =
print), but otherwise respects the original format =
string.</div><div><br></div><div><div>(set! =
exception-format</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(lambda =
(port fmt . args)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;(apply format port (rewrite-fmt (rewrite-fmt fmt "~s") "~a") =
args)))</div></div><div><br></div><div>Anyway. These are clunky hacks. =
According to the =
manual</div><div><code><br></code></div><div><blockquote =
type=3D"cite"><code>~A</code> indicates an
argument printed using <code>display</code>, while <code>~S</code> =
indicates an
argument printed using =
<code>write</code></blockquote></div><div><br></div><div><div>I think =
this is an unnecessary complication if there's a hook. One option (that =
works like =91write=92 by default) is enough. If one wants to craft a =
special error message, that should be done without abusing the exception =
arguments.</div><div><br></div></div><div>I think this =91write=92 =
should be a hook or even a fluid. There is already a hook to configure =
the REPL printer, which is set by (repl-default-option-set! 'print ##) =
or (repl-option-set! repl 'print ##) (the latter is undocumented). Maybe =
that hook can be reused for the exception printer. Or maybe there can be =
a new hook that is reused by both the repl and the exception printer. It =
makes sense to me to make both of these refer to the same =
function.</div><div><br></div><div>I also agree with David that both the =
REPL and the exception printers should be truncated by default. That =
requires truncated-print to be available in (ice-9 =
boot).</div><div><br></div><div>Anyway, just some =
thoughts.</div><div><br></div></div><div><div>See the related bug#<span =
style=3D"font-family: IowanOldStyle-Roman;">29669 about REPL =
printers.&nbsp;</span></div></div><div><span style=3D"font-family: =
IowanOldStyle-Roman;"><br></span></div><div><font =
face=3D"IowanOldStyle-Roman">Regards</font></div><div><font =
face=3D"IowanOldStyle-Roman"><br></font></div><div><font =
face=3D"IowanOldStyle-Roman"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>Daniel</font></div></body></html>=

--Apple-Mail=_FA577E85-4A48-4D93-B0A0-81A700BF3CF0--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: ludo@HIDDEN (Ludovic =?UTF-8?Q?Court=C3=A8s?=)
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Sun, 01 Jul 2018 16:31:01 +0000
Resent-Message-ID: <handler.29684.B29684.153046262631677 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: David Pirotte <david@HIDDEN>
Cc: 29684 <at> debbugs.gnu.org
Received: via spool by 29684-submit <at> debbugs.gnu.org id=B29684.153046262631677
          (code B ref 29684); Sun, 01 Jul 2018 16:31:01 +0000
Received: (at 29684) by debbugs.gnu.org; 1 Jul 2018 16:30:26 +0000
Received: from localhost ([127.0.0.1]:42278 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fZfF4-0008Eq-GY
	for submit <at> debbugs.gnu.org; Sun, 01 Jul 2018 12:30:26 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54841)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1fZfF2-0008Ed-Ne
 for 29684 <at> debbugs.gnu.org; Sun, 01 Jul 2018 12:30:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1fZfEw-0003m5-J0
 for 29684 <at> debbugs.gnu.org; Sun, 01 Jul 2018 12:30:19 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43704)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1fZfEw-0003m1-Dm; Sun, 01 Jul 2018 12:30:18 -0400
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 <ludo@HIDDEN>)
 id 1fZfEv-0002Eq-QU; Sun, 01 Jul 2018 12:30:18 -0400
From: ludo@HIDDEN (Ludovic =?UTF-8?Q?Court=C3=A8s?=)
References: <20171213012435.34d43175@capac>
Date: Sun, 01 Jul 2018 18:30:16 +0200
In-Reply-To: <20171213012435.34d43175@capac> (David Pirotte's message of "Wed, 
 13 Dec 2017 01:26:33 -0200")
Message-ID: <87in5yrk9z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
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: -6.0 (------)

Hi David,

David Pirotte <david@HIDDEN> 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.




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Sun, 01 Jul 2018 22:24:02 +0000
Resent-Message-ID: <handler.29684.B29684.15304838175744 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: ludo@HIDDEN (Ludovic =?UTF-8?Q?Court=C3=A8s?=)
Cc: 29684 <at> debbugs.gnu.org
Received: via spool by 29684-submit <at> debbugs.gnu.org id=B29684.15304838175744
          (code B ref 29684); Sun, 01 Jul 2018 22:24:02 +0000
Received: (at 29684) by debbugs.gnu.org; 1 Jul 2018 22:23:37 +0000
Received: from localhost ([127.0.0.1]:42431 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fZkkp-0001UY-L4
	for submit <at> debbugs.gnu.org; Sun, 01 Jul 2018 18:23:37 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:36959)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1fZkkn-0001UP-IB
 for 29684 <at> debbugs.gnu.org; Sun, 01 Jul 2018 18:23:34 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id 7AC05A04C167;
 Mon,  2 Jul 2018 00:23:32 +0200 (CEST)
Received: from maximusconfessor.all2all.org ([192.168.0.1])
 by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new,
 port 10024)
 with ESMTP id PMM9p7UOWFJY; Mon,  2 Jul 2018 00:23:28 +0200 (CEST)
Received: from capac (unknown [179.210.16.180])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 67936A04C165;
 Mon,  2 Jul 2018 00:23:27 +0200 (CEST)
Date: Sun, 1 Jul 2018 19:23:21 -0300
From: David Pirotte <david@HIDDEN>
Message-ID: <20180701192321.75afe2e1@capac>
In-Reply-To: <87in5yrk9z.fsf@HIDDEN>
References: <20171213012435.34d43175@capac>
	<87in5yrk9z.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 boundary="Sig_/wl9NzmQI4hWh/0q49swFD7c"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
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: -1.7 (-)

--Sig_/wl9NzmQI4hWh/0q49swFD7c
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello Ludovic,

> ...
> 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 m=
akes 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 i=
mplements.
>=20
> WDYT?
>=20
> 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.

To be honest, exactly how does not really matter, I leave that to you (main=
tainers):
I have used the code, actually written by Daniel, who also claimed it was n=
ot
complete, iirc, to raise the issue, so we can discuss it between us:

	I think we should be very (very) friendly to new Guile users, and especial=
ly
	those who do not know scheme (yet);

	I think I should be able to use Guile-CV to teach basic image manipulation
	to a class of young teenagers, who would not even know what scheme is, whi=
ch
	means, imo, no guile customization should be required:

	guile
	(use-modules (cv))
	(im-load "my-preferred-penguin.png")

	- at this point, even if the image is very small, guile is 'lost' [*]
	- same if I teach them to compose a few image ops, they commit
	a mistake while typing .. bang, the exception printer is 'lost'

It is perfectly fine, on the opposite side, to ask advanced scheme users (w=
ho would
want to, but I really don't see the point) configure guile s the repl and t=
he
exception printer so it tries to print the full content of huge lsts, vecto=
rs, arrays
...

David

[*]	one could argue i could have chosen another data structure, but well, I
	did not :), and imo, we can't tell users who have to manipulate large
	structures (arrays, vector, think about non s/w engineers scientists,
	biologists ...),	"... don't manipulate large structures in a repl, wrap th=
em
	in a record first ..."

	it happened to me at university, trying to make a demo of Guile-CV to a gr=
oup
	of postdoc candidates: I updated guile the day before and forgot to repatch
	both the repl and the exception printers, opened an image, and ... bang!

	I was in emacs, so ... after a few seconds they all laughed and ... by
	the time I could recover, repatched guile ... they were all ...
	gone! (and convinced they should stick to python and open-cv or java and
	imagej ...

--Sig_/wl9NzmQI4hWh/0q49swFD7c
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAls5VFkACgkQ83T9k6MF
etdycAgAmjlUNh7wG5nH8SfYqpANIuZtYdL/yO+QKrS4wzvWlJuJTE05BbA/pOZA
4sVdtVI/UmUc/dAwVy1WzJHH4r/slkgdZ1VeTp/knFtwsLZ+zTXASttX1A7TRS1k
3iOFanPauKs15n/zWBX3MrslHzLgCwJ6cvSVn+hAiBBYrUcPf8P8j6OFMdN2EvB5
LNBndK/2Ym3lbSdGhBpamt4r0MonJzuggQFQLczC/w4zLBUHam96og2ZBFM3j6jr
rB0kXtmPQYpDV/tuDyDudHRjubdWbHRAhELSNN4qlyahqKlbZx4alhzNkpbEzb2Y
UN20k2jYJ4ALF9tA9jhmLsmN6OEf1Q==
=619l
-----END PGP SIGNATURE-----

--Sig_/wl9NzmQI4hWh/0q49swFD7c--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: ludo@HIDDEN (Ludovic =?UTF-8?Q?Court=C3=A8s?=)
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Mon, 02 Jul 2018 06:51:01 +0000
Resent-Message-ID: <handler.29684.B29684.153051420426014 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: David Pirotte <david@HIDDEN>
Cc: 29684 <at> debbugs.gnu.org
Received: via spool by 29684-submit <at> debbugs.gnu.org id=B29684.153051420426014
          (code B ref 29684); Mon, 02 Jul 2018 06:51:01 +0000
Received: (at 29684) by debbugs.gnu.org; 2 Jul 2018 06:50:04 +0000
Received: from localhost ([127.0.0.1]:42592 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fZsey-0006lW-Jo
	for submit <at> debbugs.gnu.org; Mon, 02 Jul 2018 02:50:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47416)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1fZsex-0006kz-6W
 for 29684 <at> debbugs.gnu.org; Mon, 02 Jul 2018 02:50:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1fZseo-0007mQ-Uq
 for 29684 <at> debbugs.gnu.org; Mon, 02 Jul 2018 02:49:58 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52884)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1fZseo-0007mE-Qm; Mon, 02 Jul 2018 02:49:54 -0400
Received: from [193.50.110.150] (port=57522 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1fZseo-0003Ex-6e; Mon, 02 Jul 2018 02:49:54 -0400
From: ludo@HIDDEN (Ludovic =?UTF-8?Q?Court=C3=A8s?=)
References: <20171213012435.34d43175@capac> <87in5yrk9z.fsf@HIDDEN>
 <20180701192321.75afe2e1@capac>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 14 Messidor an 226 de la =?UTF-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 02 Jul 2018 08:49:52 +0200
In-Reply-To: <20180701192321.75afe2e1@capac> (David Pirotte's message of "Sun, 
 1 Jul 2018 19:23:21 -0300")
Message-ID: <87r2kmm8rz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
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: -6.0 (------)

Hi David,

David Pirotte <david@HIDDEN> skribis:

> It is perfectly fine, on the opposite side, to ask advanced scheme users =
(who would
> want to, but I really don't see the point) configure guile s the repl and=
 the
> exception printer so it tries to print the full content of huge lsts, vec=
tors, arrays
> ...

Perhaps you could arrange to set the REPL=E2=80=99s =E2=80=98print=E2=80=99=
 option right from
one of the Guile-OpenCV modules?  I mean the configuration you mention
have doesn=E2=80=99t have to be done manually by users.

Ludo=E2=80=99.




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Tue, 03 Jul 2018 19:32:01 +0000
Resent-Message-ID: <handler.29684.B29684.153064630529649 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: ludo@HIDDEN (Ludovic =?UTF-8?Q?Court=C3=A8s?=)
Cc: 29684 <at> debbugs.gnu.org
Received: via spool by 29684-submit <at> debbugs.gnu.org id=B29684.153064630529649
          (code B ref 29684); Tue, 03 Jul 2018 19:32:01 +0000
Received: (at 29684) by debbugs.gnu.org; 3 Jul 2018 19:31:45 +0000
Received: from localhost ([127.0.0.1]:45678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1faR1d-0007i8-5I
	for submit <at> debbugs.gnu.org; Tue, 03 Jul 2018 15:31:45 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:44032)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1faR1a-0007i0-Oq
 for 29684 <at> debbugs.gnu.org; Tue, 03 Jul 2018 15:31:43 -0400
Received: from localhost (unknown [192.168.0.2])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id BA4FDA04C11B;
 Tue,  3 Jul 2018 21:31:41 +0200 (CEST)
Received: from maximusconfessor.all2all.org ([192.168.0.1])
 by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new,
 port 10024)
 with ESMTP id cqo3qwzy8eeV; Tue,  3 Jul 2018 21:31:37 +0200 (CEST)
Received: from capac (unknown [179.210.16.57])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 43429A04C117;
 Tue,  3 Jul 2018 21:31:33 +0200 (CEST)
Date: Tue, 3 Jul 2018 16:31:23 -0300
From: David Pirotte <david@HIDDEN>
Message-ID: <20180703163123.0514c5aa@capac>
In-Reply-To: <87r2kmm8rz.fsf@HIDDEN>
References: <20171213012435.34d43175@capac> <87in5yrk9z.fsf@HIDDEN>
 <20180701192321.75afe2e1@capac> <87r2kmm8rz.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 boundary="Sig_/9dyJs65ccEdwONwvHdZ_pEg"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
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: -1.7 (-)

--Sig_/9dyJs65ccEdwONwvHdZ_pEg
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Ludovic,

> > It is perfectly fine, on the opposite side, to ask advanced scheme user=
s (who
> > would want to, but I really don't see the point) configure guile s the =
repl and
> > the exception printer so it tries to print the full content of huge lst=
s,
> > vectors, arrays ... =20

> Perhaps you could arrange to set the REPL=E2=80=99s =E2=80=98print=E2=80=
=99 option right from
> one of the Guile-OpenCV modules?  I mean the configuration you mention
> have doesn=E2=80=99t have to be done manually by users.

I'll do that yes, since I failed to convince you it you be a better default=
 for all
of us, not just Guile-CV :)

I hope I can also do that wrt exceptions in an easy way too, I did not look=
 with care
to what you suggested, since I thought what Daniel offered was a better app=
roach and
that it would be included one way or another in 2.2.4 ... let's see what I =
can cook
with set-exception-printer! then :)

Thanks,
David

Note that, for info, I named the project Guile-CV, not to refer to existing=
 libs,
and currently, it does not use Open-CV :) - which doesn't have a maintained=
 C
wrapper :(, but it would be nice to be able to use it 'from Guile-CV', ... =
one day
maybe ...

--Sig_/9dyJs65ccEdwONwvHdZ_pEg
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAls7zwsACgkQ83T9k6MF
etcCUAf/d2s/9dykRH8Pe02AzJPXsPJNOu4drkYLhHmD8GYHPbuJTalKAv0gFH+o
1KyV2csiQF2Jrt6SLs8CeY73ro4u47qfiWVUqA55zTf5szGT9EL5SmqaYGQCwAIp
63yD/xRmjMGahfLegnEMfo/QOdXAT4D1s1Yjja3Pff6nntZelLw8oBWJQfR2ZG6x
OTydAemwONuBjJnCZVF4m9nUXzR42x4ehqCYtOoYp9EckjRHARRl3Nkks0e5lFm8
X2WEfuVFw18CFz/Q0ae+HgC2L6oGn3gvpfsfjqRSe1bMVyoNAfcphFQgDp0LvotM
Fu78+k7yvtan85nlzhlZMBynjl32Cw==
=kTUD
-----END PGP SIGNATURE-----

--Sig_/9dyJs65ccEdwONwvHdZ_pEg--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: <tomas@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Wed, 04 Jul 2018 09:31:02 +0000
Resent-Message-ID: <handler.29684.B.15306966379106 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: 29684 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-guile@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.15306966379106
          (code B ref -1); Wed, 04 Jul 2018 09:31:02 +0000
Received: (at submit) by debbugs.gnu.org; 4 Jul 2018 09:30:37 +0000
Received: from localhost ([127.0.0.1]:45844 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fae7P-0002Ml-D4
	for submit <at> debbugs.gnu.org; Wed, 04 Jul 2018 05:30:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34295)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tomas@HIDDEN>) id 1fae7M-0002MX-Ac
 for submit <at> debbugs.gnu.org; Wed, 04 Jul 2018 05:30:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <tomas@HIDDEN>) id 1fae7F-00016o-Uc
 for submit <at> debbugs.gnu.org; Wed, 04 Jul 2018 05:30:26 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:34582)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <tomas@HIDDEN>) id 1fae7F-00016C-HH
 for submit <at> debbugs.gnu.org; Wed, 04 Jul 2018 05:30:25 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53499)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <tomas@HIDDEN>) id 1fae7E-0003H9-DO
 for bug-guile@HIDDEN; Wed, 04 Jul 2018 05:30:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <tomas@HIDDEN>) id 1fae7B-0000yb-99
 for bug-guile@HIDDEN; Wed, 04 Jul 2018 05:30:24 -0400
Received: from mail.tuxteam.de ([5.199.139.25]:53879)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <tomas@HIDDEN>) id 1fae7A-0000k4-UT
 for bug-guile@HIDDEN; Wed, 04 Jul 2018 05:30:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de;
 s=mail; 
 h=From:In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date;
 bh=Z47rhOGzFhEWwFgWORUQGa/oW8oi5SZXsjUnQsmxlCQ=; 
 b=IzIQotNqZyzFKwYf801fzwzxPNGBRvLCYkBsDV6M1HBr0yVyt023uqQIFGzdOoQZdUXuQQNA3gFCgGIugyOLIgbYf0jFd2EJpfYRbBN0N7ab2TWsGiac6cv5u8mVywGpz0B455RiMC+yya0E4Q36q81VjrMkD125tGNsC4LcVjS1F5l6B4+kUmH5zXP3wX/IJ21WbvWI8oCsZ19mDFKDUfTcoFqMXs6eWpy5V+R+/B+LPTOli2iveLPbIjxHXlej9O4dmg7re8xl8YGxUWalqT44Jy6vQNchIDzm/NsdPyHg3FKxu/z0BSg+xPiLLh5VFXnu/2mzLX8RCxtY28ivfA==;
Received: from tomas by mail.tuxteam.de with local (Exim 4.80)
 (envelope-from <tomas@HIDDEN>) id 1fae73-0006Wr-8Y
 for bug-guile@HIDDEN; Wed, 04 Jul 2018 11:30:13 +0200
Date: Wed, 4 Jul 2018 11:30:12 +0200
Message-ID: <20180704093012.GA23703@HIDDEN>
References: <20171213012435.34d43175@capac> <87in5yrk9z.fsf@HIDDEN>
 <20180701192321.75afe2e1@capac> <87r2kmm8rz.fsf@HIDDEN>
 <20180703163123.0514c5aa@capac>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; x-action=pgp-signed
Content-Transfer-Encoding: 8bit
In-Reply-To: <20180703163123.0514c5aa@capac>
User-Agent: Mutt/1.5.21 (2010-09-15)
From: <tomas@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
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: -5.0 (-----)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Jul 03, 2018 at 04:31:23PM -0300, David Pirotte wrote:
> Hi Ludovic,
> 
> > > It is perfectly fine, on the opposite side, to ask advanced scheme users (who
> > > would want to, but I really don't see the point) configure guile s the repl and
> > > the exception printer so it tries to print the full content of huge lsts,
> > > vectors, arrays ...  
> 
> > Perhaps you could arrange to set the REPL’s ‘print’ option right from
> > one of the Guile-OpenCV modules?  I mean the configuration you mention
> > have doesn’t have to be done manually by users.
> 
> I'll do that yes, since I failed to convince you it you be a better default for all
> of us, not just Guile-CV :)

Hm. Applying the peanut gallery factor to my opinion (roughly 10e-7), I tend to
side with David's position: the default consumer of REPL's print is a human, and
feeding him/her with huge binary things isn't "tasty"...

But... grain of salt, and things. What would be David's position's downsides?

Thanks
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAls8k6QACgkQBcgs9XrR2kaJSgCePeZgTTphZmdrkww/uoVm/9mW
Ib4An2/NY2kWS6Oso7w9jzSP8s9x9mZz
=KsrJ
-----END PGP SIGNATURE-----




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#29684: exception printers - request for improvement
Resent-From: David Pirotte <david@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Sat, 04 Aug 2018 02:18:02 +0000
Resent-Message-ID: <handler.29684.B29684.153334905318184 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 29684
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: <tomas@HIDDEN>
Cc: 29684 <at> debbugs.gnu.org
Received: via spool by 29684-submit <at> debbugs.gnu.org id=B29684.153334905318184
          (code B ref 29684); Sat, 04 Aug 2018 02:18:02 +0000
Received: (at 29684) by debbugs.gnu.org; 4 Aug 2018 02:17:33 +0000
Received: from localhost ([127.0.0.1]:40336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1flm8L-0004jE-Ah
	for submit <at> debbugs.gnu.org; Fri, 03 Aug 2018 22:17:33 -0400
Received: from maximusconfessor.all2all.org ([79.99.200.102]:39732)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <david@HIDDEN>) id 1flm8J-0004j5-Nn
 for 29684 <at> debbugs.gnu.org; Fri, 03 Aug 2018 22:17:32 -0400
Received: from localhost (localhost [127.0.0.1])
 by maximusconfessor.all2all.org (Postfix) with ESMTP id A4E421BE00E0;
 Sat,  4 Aug 2018 04:17:30 +0200 (CEST)
Received: from maximusconfessor.all2all.org ([127.0.0.1])
 by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new,
 port 10024)
 with ESMTP id jMeaZR_Nkdoi; Sat,  4 Aug 2018 04:17:30 +0200 (CEST)
Received: from capac (unknown [189.122.100.197])
 by maximusconfessor.all2all.org (Postfix) with ESMTPSA id B1BE81BE00DF;
 Sat,  4 Aug 2018 04:17:29 +0200 (CEST)
Date: Fri, 3 Aug 2018 23:17:22 -0300
From: David Pirotte <david@HIDDEN>
Message-ID: <20180803231722.26278aad@capac>
In-Reply-To: <20180704093012.GA23703@HIDDEN>
References: <20171213012435.34d43175@capac> <87in5yrk9z.fsf@HIDDEN>
 <20180701192321.75afe2e1@capac> <87r2kmm8rz.fsf@HIDDEN>
 <20180703163123.0514c5aa@capac> <20180704093012.GA23703@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 boundary="Sig_/JkRIcP0aFMWWBxpJyYHAzAR"; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
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: -1.7 (-)

--Sig_/JkRIcP0aFMWWBxpJyYHAzAR
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi Thomas,

> ...
> Hm. Applying the peanut gallery factor to my opinion (roughly 10e-7), I t=
end to
> side with David's position: the default consumer of REPL's print is a hum=
an, and
> feeding him/her with huge binary things isn't "tasty"...

> But... grain of salt, and things. What would be David's position's downsi=
des?

If the change I'm proposing is implemented in such a way that it still offe=
r,
through an option mechanism, to display several lines ... (and it has to be
implemented this way, as also spotted by Andy in a subsequent email), then
I fail to see any downsides.

Regards,
David

--Sig_/JkRIcP0aFMWWBxpJyYHAzAR
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAltlDLIACgkQ83T9k6MF
ete/6wf8CoYu8kyxqikJc/+N34t8Ppzl+Ol+A97WB3i8KG0c501/ZGEWxQk6NX9p
IkTme8Po1ItMaWDUsVVMuHrpkFuD4nb54yfq2RhMUJjlarDCO2crAwWaodB3SKhu
UTqRhj9/z/u9dPYLpHXyeYGdVlImdRDq6rTwqaoT4xXkNStAvwjdYQ6n5si7AlxH
EQhyOpxHI7Bfc5Md3LKbh3CO/0U4hxcCge8hBDRkTznOCZsiL5D0J0X/SH2PAw0C
Zp/0781BE1sIh6HvlUiaYMGmZqGj4GFdlLT/f8kAK0kxGDyRn+r8S5jSy3RESBfj
C5yi1qjnDBnzDqsx14hn3aQ7zRnwXg==
=wyzp
-----END PGP SIGNATURE-----

--Sig_/JkRIcP0aFMWWBxpJyYHAzAR--





Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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