summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-25 10:57:12 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-25 10:57:12 -0800
commitc485146a246ab4b69e6ec510ec47713897f4d463 (patch)
tree3e22b6ac0f756258851a0e280dac9aeb012931c9 /txr.1
parent41ea4bd2c8791696525aadb0a457ba36fa1d204e (diff)
downloadtxr-c485146a246ab4b69e6ec510ec47713897f4d463.tar.gz
txr-c485146a246ab4b69e6ec510ec47713897f4d463.tar.bz2
txr-c485146a246ab4b69e6ec510ec47713897f4d463.zip
New handle* macro, analogous to catch*.
* share/txr/stdlib/except.tl (sys:expand-handle): New function. (handle): Use sys:expand-handle to expand arguments. The previously unused :whole form argument is now put to use, and correctly captured using :form rather than :whole. (handle*): New macro. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.116
1 files changed, 15 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 4abfebb1..d21cdbd3 100644
--- a/txr.1
+++ b/txr.1
@@ -33315,10 +33315,12 @@ exception search as if it didn't exist. When the handler function terminates,
either via a normal return or a nonlocal control transfer, then the handler is
re-enabled.
-.coNP Macro @ handle
+.coNP Macros @ handle and @ handle*
.synb
.mets (handle < try-expression
.mets \ \ >> {( symbol <> ( arg *) << body-form *)}*)
+.mets (handle* < try-expression
+.mets \ \ >> {( symbol >> ( type-arg << arg *) << body-form *)}*)
.syne
.desc
The
@@ -33370,6 +33372,18 @@ via
.code return
or throwing an exception.
+The
+.code handle*
+macro is a variant of
+.code handle
+with the following difference: when
+.code handle*
+invokes a clause, it passes the exception symbol as the leftmost argument
+.metn type-arg .
+Then the exception arguments follow. In contrast,
+only the exception arguments are passed to the clauses of
+.codn handle .
+
.coNP Macro @ with-resources
.synb
.mets (with-resources >> ({ sym >> [ init-form <> [ cleanup-form ])}*)