From: Andreas Rottmann <a.rottmann@gmx.at>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: R6RS exception printing at the REPL
Date: Thu, 02 Dec 2010 21:21:55 +0100 [thread overview]
Message-ID: <8762vc0vto.fsf@delenn.lan> (raw)
In-Reply-To: <87zkspulx5.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 02 Dec 2010 00:13:10 +0100")
ludo@gnu.org (Ludovic Courtès) writes:
> Hello there!
>
> Andy Wingo <wingo@pobox.com> writes:
>
>> On Sat 27 Nov 2010 01:08, Andreas Rottmann <a.rottmann@gmx.at> writes:
>>
>>> to not lose current functionality, `print-exception' and exception
>>> printer procedures would need a `frame' argument as well, right?
>>
>> I guess. I never liked that, though; sounds like a needless tangling of
>> concerns. What does having the frame give us? Just source, or the
>> function name, or what? It seems like a message about the context in
>> which the error occurred could just as well come before the error is
>> printed out.
>>
>> What do you think? What does Ludovic think? :)
>
> I don’t think, actually. :-)
>
> Well, at first I thought exception printers could be nice. Currently,
> there’s a single exception printer, which makes assumptions about the
> arguments to ‘throw’. Namely, it expects (throw KEY FUNC FORMAT-STRING
> FORMAT-ARG ...), or something like that. When that is honored,
> exceptions are displayed in a human-readable way, otherwise they are
> (very) badly printed, which could be improved.
>
Well, the point is that for R6RS and SRFI-34 exceptions, this convention
is never honored, and it makes perfect sense IMO to introduce a
mechanism that allows Guile to deal with alternative conventions already
present in its code base.
> OTOH, exceptions are a programming mechanism, not a UI mechanism, so one
> could argue that it’s up to the application to define how to present
> exceptions to the user.
>
AFAIU, the proposed API is there to influence the presentation of
exceptions that are _not_ handled by the application. The achieved
better representation of exceptions is a convinience for developers, and
not something that should make a difference for the user of a
Guile-based application, in the absence of any bugs in said application.
If there is a bug, however, and thus an exception escapes to Guile's
exception handler, a better presentation will allow for better bug
reports (again, a convinience for the developer).
> I think I’m slightly skeptical about system-wide exception printers
> because of this, and also because system-wide settings are evil.
>
I somewhat share that sentiment -- the global registry feels a bit
awkward; perhaps it should be stored in a fluid? Also, I'd rather have
the proposed API be Guile-internal, but I don't know how to properly
achieve that.
Regards, Rotty
--
Andreas Rottmann -- <http://rotty.yi.org/>
next prev parent reply other threads:[~2010-12-02 20:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 21:46 R6RS exception printing at the REPL Andreas Rottmann
2010-11-20 15:23 ` Andy Wingo
2010-11-20 18:18 ` Andreas Rottmann
2010-11-20 20:19 ` Andy Wingo
2010-11-27 0:08 ` Andreas Rottmann
2010-11-29 20:15 ` @ and @@ in r6rs libs [Was: R6RS exception printing at the REPL] Andy Wingo
2010-11-29 22:35 ` Andreas Rottmann
2010-11-29 20:34 ` R6RS exception printing at the REPL Andy Wingo
2010-11-29 23:20 ` Andreas Rottmann
2010-12-01 23:16 ` Ludovic Courtès
2010-12-01 23:13 ` Ludovic Courtès
2010-12-02 20:21 ` Andreas Rottmann [this message]
2010-12-13 16:49 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8762vc0vto.fsf@delenn.lan \
--to=a.rottmann@gmx.at \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).