From d6c12a2fe298112844c032c7a5f439c2dfb4ada1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 1 Feb 2021 07:57:44 -0800 Subject: matcher: bugfix: bad stray code in @[...] matcher. * share/txr/stdlib/match.tl (compile-dwim-predicate-match): In he one-argument case, there is stray code referencing var-match.test-expr, which blows up. This is hit by exactly the one example in the documentation that was not added as a test case. * tests/011/patmatch.tl: Add test case from doc. --- share/txr/stdlib/match.tl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'share') diff --git a/share/txr/stdlib/match.tl b/share/txr/stdlib/match.tl index 8518d68f..2c47ca2a 100644 --- a/share/txr/stdlib/match.tl +++ b/share/txr/stdlib/match.tl @@ -262,8 +262,7 @@ pat-match.guard-chain)))) (progn var-match.(add-guard-pre (new match-guard - guard-expr ^(and ,var-match.test-expr - [,fun ,obj-var]))) + guard-expr ^[,fun ,obj-var])) var-match))))) (defun compile-predicate-match (pred-expr obj-var var-list) -- cgit v1.2.3