Map destructuring

This commit is contained in:
2020-12-07 18:52:33 -07:00
parent b28a39250d
commit 6866c7133d
3 changed files with 29 additions and 12 deletions

View File

@@ -348,4 +348,9 @@
(Assert.equals "me" (dict-get myMap "found"))
(doFor =>key value myMap
(Assert.isTrue (<= 0 (.indexOf ["hey" "found"] key)))
(Assert.isTrue (<= 0 (.indexOf ["you" "me"] value)))))
(Assert.isTrue (<= 0 (.indexOf ["you" "me"] value))))
// Map destructuring:
(let [[=>"hey" v1 =>"found" v2] myMap]
(Assert.equals "you" v1)
(Assert.equals "me" v2)))