guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Let (format) used in exceptions be overriden


From: Mark H Weaver
Subject: Re: [PATCH] Let (format) used in exceptions be overriden
Date: Sat, 20 Oct 2018 15:36:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Daniel,

address@hidden writes:

> From: Daniel Llorens <address@hidden>
>
> * module/ice-9/boot-9.scm (exception-format): new variable. Globally
>   replace uses of (format) by (exception-format).

What's the rationale for this proposed change?

All but one of the occurrences of 'format' that you replaced had a
literal (i.e. constant) format string that only uses the escapes
supported by 'simple-format', so I'm not sure why you need those to be
overridden.

The only occurrence with a non-literal format string that you changed is
in 'false-if-exception', in the case when the #:warning keyword is
passed by the user along with a template string and arguments.

In general, I'd like to strongly discourage the practice of modifying
global variables to swap in extended variants of widely used procedures
such as format.  That method breaks down badly when two different
modules try to extend core functionality in different ways.

If you want to make 'false-if-exception' extensible, I would prefer to
instead provide a third syntax that allows the user to pass a custom
'format' procedure.

What do you think?

    Regards,
      Mark



reply via email to

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