[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29684: exception printers - request for improvement
From: |
David Pirotte |
Subject: |
bug#29684: exception printers - request for improvement |
Date: |
Wed, 13 Dec 2017 01:26:33 -0200 |
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
Description: Text Data
pgpimXYri8op8.pgp
Description: OpenPGP digital signature
- bug#29684: exception printers - request for improvement,
David Pirotte <=