unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Andreas Rottmann <a.rottmann@gmx.at>
Cc: Guile Development <guile-devel@gnu.org>
Subject: Re: R6RS exception printing -- take #2
Date: Tue, 01 Feb 2011 21:06:16 +0100	[thread overview]
Message-ID: <m3aaifwmdj.fsf@unquote.localdomain> (raw)
In-Reply-To: <87y660txmd.fsf@rotty.yi.org> (Andreas Rottmann's message of "Tue, 01 Feb 2011 01:19:22 +0100")

Heya Andreas,

You proposed a choice between two options:

On Tue 01 Feb 2011 01:19, Andreas Rottmann <a.rottmann@gmx.at> writes:

>   exception-printer := port key args exception-printer -> nothing
>   exception-printer := port args thunk

The `key' argument is necessary, at least if you want one printer to
handle multiple keys (as the default printer might).  I prefer the
first, FWIW.

> This exception registry would be used in the REPL error-handling code
> primarily, via a `print-exception' procedure querying the registry and
> invoking the matching printer (or the default one, if no printer is
> matching).

There are other cases that it would be nice to use it: in the catch-all
in throw.c, and in general when printing exceptions from C.

> Another open issue is the potential `frame' argument; it seems this is
> only used at one place in `(system repl error-handling)', inside
> `call-with-error-handling' (I did a quick grep for "display-error" and
> "Throw to" to identify the sites where I'd plug in the exception
> registry via the `print-exception' procedure).
>
> If we decide that `frame' should not be part of the exception-printer
> arguments, we'd lose source information in the exception printout in
> this case.

Let's keep the frame out of the exception-printer functions, but still
pass it to the procedure that does the exception printing dispatch
(perhaps called print-exception or something).  That way we can print
source information, then let exception printers do their thing.

> [ Just a thought: it looks like it /might/ make sense to contemplate
>   deprecating passing the frame information to `display-error' and
>   untangle displaying the exception object and displaying a backtrace
>   completely. ]

There are certainly some tangles here.  If you find The Right Thing, let
us know...

Andy
-- 
http://wingolog.org/



  parent reply	other threads:[~2011-02-01 20:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01  0:19 R6RS exception printing -- take #2 Andreas Rottmann
2011-02-01  1:07 ` Andreas Rottmann
2011-02-01 20:06 ` Andy Wingo [this message]
2011-02-06 18:09   ` Andreas Rottmann
2011-02-11 15:08     ` Andy Wingo
2011-02-07 12:07   ` [PATCH] " Andreas Rottmann

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=m3aaifwmdj.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=a.rottmann@gmx.at \
    --cc=guile-devel@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).