GNU bug report logs - #29684
exception printers - request for improvement

Previous Next

Package: guile;

Reported by: David Pirotte <david <at> altosw.be>

Date: Wed, 13 Dec 2017 03:28:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: David Pirotte <david <at> altosw.be>
To: 29684 <at> debbugs.gnu.org
Subject: bug#29684: exception printers - request for improvement
Date: Wed, 13 Dec 2017 01:26:33 -0200
[Message part 1 (text/plain, inline)]
Hello,

	The attached patched is from Daniel Lloren, I'm just 'a messenger' (and added
	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 manipulate large
structures, lists, arrays, sfri-4 bytevectors, ..., something we have been doing
locally ... but we need something for our users (aiscm, guile-cv ...), so they 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))
                    
	(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
[0002-Allowing-exception-printers-user-customization.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

This bug report was last modified 6 years and 363 days ago.

Previous Next


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