From 88b3ac140300a6014e271ff02e0e6901d35f18d1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 22 Jan 2021 06:27:40 -0800 Subject: matcher: document hash and some fixes. * share/txr/stdlib/match.tl (compile-hash-match): Follow rename of is-pattern function to non-triv-pat-p. (is-pattern): Renamed to non-triv-pat-p, to follow terminology in the reference manual. A bug is fixed here: we must recognize cons patterns with operators and variables in the dotted position as non-trivial. * tests/011/patmatch.tl: New hash test case, from doc. * txr.1: Documented hash pattern operator. --- tests/011/patmatch.tl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/011') diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl index 2b1e26c8..a9bd57fa 100644 --- a/tests/011/patmatch.tl +++ b/tests/011/patmatch.tl @@ -129,3 +129,6 @@ ((4 @x) x) ((@x 5) x))) (3 5 3 6 (11 12) (2 time) (2020 1) (vec tor))) + +(test (when-match @(hash (x @y) (@y @datum)) #H(() (x k) (k 42)) datum) + (42)) -- cgit v1.2.3