[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: R6RS exception printing -- take #2
From: |
Andy Wingo |
Subject: |
Re: R6RS exception printing -- take #2 |
Date: |
Tue, 01 Feb 2011 21:06:16 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Heya Andreas,
You proposed a choice between two options:
On Tue 01 Feb 2011 01:19, Andreas Rottmann <address@hidden> 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/
- Re: R6RS exception printing -- take #2,
Andy Wingo <=