summaryrefslogtreecommitdiffstats
path: root/share/txr/stdlib/except.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-29 22:40:17 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-29 22:40:17 -0800
commit742f4908ae6b3f03930434594a56e5449e5fe4f2 (patch)
treef70241e038aa5bf4aa2cf32a693f8ec4f348867e /share/txr/stdlib/except.tl
parentfb5b723fb7da2824a29cac475381056e3dfe1d52 (diff)
downloadtxr-742f4908ae6b3f03930434594a56e5449e5fe4f2.tar.gz
txr-742f4908ae6b3f03930434594a56e5449e5fe4f2.tar.bz2
txr-742f4908ae6b3f03930434594a56e5449e5fe4f2.zip
conformance: handle macro wrong clause syntax.
Contrary to the documentation, handle doesn't in fact have the same syntax as catch. It passes the exception symbol to clauses as the leftmost argument, followed by the exception arguments, whereas catch passes only the exception arguments. * share/txr/stdlib/except.tl (handle): Do not pass the exception sybmol as the leftmost argument, unless operating in TXR 161 or earlier compatibility. * tests/012/except.tl: drop exception symbol argument from handle clause. * txr.1: Compatibility note added.
Diffstat (limited to 'share/txr/stdlib/except.tl')
-rw-r--r--share/txr/stdlib/except.tl5
1 files changed, 4 insertions, 1 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