summaryrefslogtreecommitdiffstats
path: root/tests/011
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-01-22 06:27:40 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-01-22 06:27:40 -0800
commit88b3ac140300a6014e271ff02e0e6901d35f18d1 (patch)
tree9ce88c5f5b1a329cb9bbdb66efb35293b7dde871 /tests/011
parent79e8b2534690bf7c427c28de7738705d5a372502 (diff)
downloadtxr-88b3ac140300a6014e271ff02e0e6901d35f18d1.tar.gz
txr-88b3ac140300a6014e271ff02e0e6901d35f18d1.tar.bz2
txr-88b3ac140300a6014e271ff02e0e6901d35f18d1.zip
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.
Diffstat (limited to 'tests/011')
-rw-r--r--tests/011/patmatch.tl3
1 files changed, 3 insertions, 0 deletions
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))