guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enable truncation of exception output


From: Andy Wingo
Subject: Re: Enable truncation of exception output
Date: Fri, 10 Mar 2017 09:47:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

On Fri 03 Feb 2017 14:40, Daniel Llorens <address@hidden> writes:

> The patch to master (ice-9 boot-9) lets you override the (format) used
> internally by the exception printers. Then I rewrite the format string
> in user code, see below. It's a bit hacky, maybe someone has a better
> solution.
>
> See also the other patch I've posted to the list to support arrays in
> (truncated-print). The patches are independent, but they make each
> other useful so to speak.

I have a crazy idea :)  What about, we just let (ice-9 format) be
"format" ?  Right now loading (ice-9 format) does a set! to format, as
you know, overriding the core binding.  This is unnecessary and
complicated.  I see that using (ice-9 format) only adds 50 KB to the
2828-KB baseline of private dirty memory.  Then we can use :@y
directly in the format strings and we can avoid all the monkeypatching.

There are only a couple instances of calls to scm_simple_format in
libguile and they can be replaced, so we don't have C bootstrapping
concerns.  Guile users calling scm_simple_format would do a pthread_once
load to the "format" binding in the root module.  In boot-9, we start
with a simple boot definition (for boot-time errors) then replace it
with (module-ref (resolve-interface '(ice-9 format) 'format)) at the
end.

Maybe Ludovic has a thought here :)

Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]