From 6064e82e88b9a1d652b68bd1ea64f229aa76dd65 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sun, 9 Jan 2022 11:36:20 -0800 Subject: Add wildcard to pattern syntax. --- match-test.csc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'match-test.csc') diff --git a/match-test.csc b/match-test.csc index 3fed862..2728e44 100644 --- a/match-test.csc +++ b/match-test.csc @@ -18,7 +18,7 @@ (1 1) (2 2) (3 3) - (else 4)) + (_ 4)) 3) (test-case "match-list" @@ -27,12 +27,20 @@ ((1 2) 1) ((1 2 3) 2) ((1 2 3 4) 3) - (else 4)) + (_ 4)) 2) (test-case "binding" (match '(1 2 3) ((1 (! x) 3) x)) + 2) + (test-case + "ignore" + (match '(1 2 3) + ((_ _ _ _) 0) + ((2 _ _) 1) + ((1 _ _) 2) + (_ 3)) 2)))) (for-each (lambda (tc) -- cgit v1.3.1