diff options
author | Kaz Kyheku <kaz@kylheku.com> | 2020-01-30 00:05:40 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-01-30 00:05:40 -0800 |
commit | a6e837526bf5052ef6292860784b786e5c720f0a (patch) | |
tree | f553d7e3bf6c3a67805daab2f3cd6b6633b0b8d4 | |
parent | f7b694183157b674abf68df1b830cadd93e18cdd (diff) | |
download | txr-a6e837526bf5052ef6292860784b786e5c720f0a.tar.gz txr-a6e837526bf5052ef6292860784b786e5c720f0a.tar.bz2 txr-a6e837526bf5052ef6292860784b786e5c720f0a.zip |
New retry and skip exceptions under restart hierarchy.
* unwind.c (uw_late_init): Register retry and skip symbols
as exception subtypes of restart.
* txr.1: Document retry and skip restarts.
-rw-r--r-- | txr.1 | 19 | ||||
-rw-r--r-- | unwind.c | 2 |
2 files changed, 20 insertions, 1 deletions
@@ -40960,7 +40960,11 @@ subtype of every exception type: .verb t ----+--- warning | - +--- restart --- continue + +--- restart ---+--- continue + | | + | +--- retry + | | + | +--- skip | +--- error ---+--- type-error | @@ -41004,6 +41008,19 @@ type. The type is intended to be the root of a hierarchy of exception types used for denoting restart points: designers are encouraged to derive restarts from this type. +A catch for the +.code continue +exception should be established around constructs which can throw an +error from which it is possible to recover. That exception provides +the entry point into the recovery which resumes execution. +A catch for +.code retry +should be provided in situations when it is possible and makes sense for a failed +operation to be tried again. +A catch for +.code skip +should be provided in situations when it is possible and sensible to continue +with subsequent operations even though an operation has failed. .NP* Dialect Notes @@ -1314,6 +1314,8 @@ void uw_late_init(void) reg_fun(intern(lit("find-frames-by-mask"), user_package), func_n1(uw_find_frames_by_mask)); #endif uw_register_subtype(continue_s, restart_s); + uw_register_subtype(intern(lit("retry"), user_package), restart_s); + uw_register_subtype(skip_s, restart_s); uw_register_subtype(warning_s, t); uw_register_subtype(defr_warning_s, warning_s); } |