summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/except.tl5
-rw-r--r--tests/012/except.tl2
-rw-r--r--txr.121
3 files changed, 26 insertions, 2 deletions
diff --git a/share/txr/stdlib/except.tl b/share/txr/stdlib/except.tl
index addc3a66..dee1bb6f 100644
--- a/share/txr/stdlib/except.tl
+++ b/share/txr/stdlib/except.tl
@@ -36,7 +36,10 @@
(unless (symbolp name)
(sys:handle-bad-syntax hc))
(list name ^(apply (lambda ,arglist ,*body)
- ,exc-sym ,exc-args)))
+ ,*(if (and (plusp sys:compat)
+ (<= 161 sys:compat))
+ ^(,exc-sym))
+ ,exc-args)))
(else (sys:handle-bad-syntax hc))))))
^(handler-bind (lambda (,exc-sym . ,exc-args)
(cond
diff --git a/tests/012/except.tl b/tests/012/except.tl
index 1eb85017..7fe9dad2 100644
--- a/tests/012/except.tl
+++ b/tests/012/except.tl
@@ -8,7 +8,7 @@
(test
(handle (list (cont (throw 'd 1))
(cont (throw 'c 2)))
- (a (exc arg)
+ (a (arg)
(let ((cont (find-frame 'cont)))
(if cont
(progn
diff --git a/txr.1 b/txr.1
index e422faf3..507d3f0a 100644
--- a/txr.1
+++ b/txr.1
@@ -50389,6 +50389,27 @@ of these version values, the described behaviors are provided if
is given an argument which is equal or lower. For instance
.code "-C 103"
selects the behaviors described below for version 105, but not those for 102.
+.IP 161
+Version 161 was the last version in which a bug existed in the
+.code handle
+macro. In spite of the documentation claiming that
+.code handle
+has the same syntax as
+.codn catch ,
+the clauses of
+.code handle
+were being passed the exception symbol as the leftmost argument, followed
+by the exception arguments. This convention is different from
+.code catch
+clauses which do not receive the exception symbol, only the arguments.
+The discrepancy was corrected by making
+.code handle
+behave like
+.codn catch ,
+as documented. Requesting compatibility with 161 or earlier restores
+the previous behavior of the
+.code handle
+macro.
.IP 156
After version 156, two behaviors changed in the in the macro expander for
.codn caseq ,