diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/except.tl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/share/txr/stdlib/except.tl b/share/txr/stdlib/except.tl index dee1bb6f..f7f87b0a 100644 --- a/share/txr/stdlib/except.tl +++ b/share/txr/stdlib/except.tl @@ -27,6 +27,10 @@ (defun sys:handle-bad-syntax (item) (throwf 'eval-error "~s: bad clause syntax: ~s" 'handle item)) +(defmacro catch (try-form . handle-clauses) + (let ((catch-syms [mapcar car handle-clauses])) + ^(sys:catch ,catch-syms ,try-form ,*handle-clauses))) + (defmacro handle (:whole form try-form . handle-clauses) (let* ((exc-sym (gensym)) (exc-args (gensym)) |