summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/except.tl7
1 files changed, 5 insertions, 2 deletions
diff --git a/share/txr/stdlib/except.tl b/share/txr/stdlib/except.tl
index 0f81e763..2fb21f9d 100644
--- a/share/txr/stdlib/except.tl
+++ b/share/txr/stdlib/except.tl
@@ -27,10 +27,13 @@
(defun sys:handle-bad-syntax (item)
(throwf 'eval-error "~s: bad clause syntax: ~s" 'handle item))
-(defmacro catch (:form form try-form . catch-clauses)
+(defmacro catch (:form form :env e try-form . catch-clauses)
(let ((catch-syms [mapcar car catch-clauses])
(sys-catch-clauses (mapcar (do mac-param-bind @1 (type args . body) @1
- ^(,type (,(gensym) ,*args) ,*body))
+ (tree-bind (args-ex . body-ex)
+ (sys:expand-params args body
+ e nil form)
+ ^(,type (,(gensym) ,*args-ex) ,*body-ex)))
catch-clauses)))
^(sys:catch ,catch-syms ,try-form ,*sys-catch-clauses)))