aboutsummaryrefslogtreecommitdiff
path: root/module/hnh
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-17 22:23:01 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-28 14:17:47 +0200
commiteaece56148ae3560c4c249dd0fc9b63dd65d4fa4 (patch)
tree9e4b9a9ba55554033232495fa463b6726904d42d /module/hnh
parentNormalize errors. (diff)
downloadcalp-eaece56148ae3560c4c249dd0fc9b63dd65d4fa4.tar.gz
calp-eaece56148ae3560c4c249dd0fc9b63dd65d4fa4.tar.xz
Add catch*
Diffstat (limited to 'module/hnh')
-rw-r--r--module/hnh/util.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/module/hnh/util.scm b/module/hnh/util.scm
index e766cd0a..3019b35b 100644
--- a/module/hnh/util.scm
+++ b/module/hnh/util.scm
@@ -13,6 +13,7 @@
and=>> label
print-and-return
begin1
+ catch*
)
#:replace (let* set! define-syntax
when unless))
@@ -577,3 +578,11 @@
(lambda ()
(for-each (lambda (pair) (setenv (car pair) (caddr pair)))
env-pairs))))]))
+
+(define-syntax catch*
+ (syntax-rules ()
+ ((_ thunk (key handler))
+ (catch (quote key) thunk handler))
+ ((_ thunk (key handler) rest ...)
+ (catch* (lambda () (catch (quote key) thunk handler))
+ rest ...))))