diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-04-06 06:31:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-04-06 06:31:11 -0700 |
commit | 9e4be16274554d469b64e5b240b04fe8549f8a1f (patch) | |
tree | 203677f307471db6df8861912b710d74e17771cd /termios.c | |
parent | 49d82c3b34227ec0520eb1cf1bb22083453b49a7 (diff) | |
download | txr-9e4be16274554d469b64e5b240b04fe8549f8a1f.tar.gz txr-9e4be16274554d469b64e5b240b04fe8549f8a1f.tar.bz2 txr-9e4be16274554d469b64e5b240b04fe8549f8a1f.zip |
exceptions: unhandled non-error exceptions now return.
This patch makes a fundamental change in exception behavior.
Going forward, if an exception that is not derived from
error is not handled (no catch intercepts it, and no handler
accepts it) then the throw call simply returns nil to the
caller instead of unwinding and terminating the process.
For error exceptions, the behavior is the same: the
*uhandled-hook* is called, if it exists, and if it doesn't
exist or returns, unwinding and termination with diagnostics
ensues.
The rationale for not treating non-error exceptions fatally
is that this simplifies the use of code that throws exceptions
for non-error situations like progress updates. The code can
be used without the caller having to establish a handler.
* txr.1: Documentation updates and comaptibility notes.
* unwind.c (uw_rthrow): New returning throw function based on
the implementation of uw_throw.
(uw_rthrowv, uw_rthrowvf): New functions.
(uw_throw): Now a wrapper for uw_rthrow. Because uw_throw
still does not return, it calls abort if uw_rthrow
returns. uw_throw is used internally only for error
exceptions.
(uw_throwv, uw_throwfv): Functions removed.
(uw_late_init): Register throw and throwf to the
new functions uw_rthrowv an uw_rthrowfv.
* unwind.h (uw_rthrow, uw_rthrowv, uw_rthrowfv): Declared.
(uw_throwv, uw_throwfv): Declarations removed.
Diffstat (limited to 'termios.c')
0 files changed, 0 insertions, 0 deletions