Extend match to support ~unquote for matching against the *value* of expressions or variables, and use that to implement deletion for the RB-tree set

This commit is contained in:
Nathan Braswell
2021-08-01 23:48:41 -04:00
parent 93fd0d1943
commit e0802baf5e
4 changed files with 85 additions and 7 deletions

View File

@@ -38,4 +38,12 @@
[ 1337 "str" 'walla + a false b [ 'inner c 'end ] d ] (str "matched, and got " a b c d)
a (+ a 1)
))
(println "seventh "
(let (b 2)
(match [ 1337 [ 1 2 3] 11 ]
1 true
"str" "It was a string!"
[ 1337 [ a ~b c] 11 ] (str "matched, and got " a c " while checking based on inserted " b)
a "sigh, failed to match"
)))
))