From c485146a246ab4b69e6ec510ec47713897f4d463 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 25 Jan 2017 10:57:12 -0800 Subject: 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. --- txr.1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'txr.1') 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 ])}*) -- cgit v1.2.3