[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29684: exception printers - request for improvement
From: |
Ludovic Courtès |
Subject: |
bug#29684: exception printers - request for improvement |
Date: |
Sun, 01 Jul 2018 18:30:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hi David,
David Pirotte <address@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 call,
> ;; 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 ‘current-error-port’. It also makes more sense
to me to parameterize ‘current-error-port’ rather than set
‘exception-format’, because the ‘exception-format’ is very constrained:
it has to implement at least everything ‘simple-format’ implements.
WDYT?
Besides, note that there’s also ‘set-exception-printer!’. It’s a
different kind of customization, but it can serve a similar purpose.
Thanks,
Ludo’.
- bug#29684: exception printers - request for improvement,
Ludovic Courtès <=