1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00

Ensure assoc updates maps properly

This commit is contained in:
Vasilij Schneidermann 2016-10-24 21:49:07 +02:00
parent 42b8fe1683
commit 3c7b63d2e1

View File

@ -260,6 +260,15 @@
(keyword? (nth (vals {"a" :abc "b" :def}) 0))
;=>true
;; Testing whether assoc updates properly
(def! hm4 (assoc {:a 1 :b 2} :a 3 :c 1))
(get hm4 :a)
;=>3
(get hm4 :b)
;=>2
(get hm4 :c)
;=>1
;; Testing nil as hash-map values
(contains? {:abc nil} :abc)
;=>true