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:
parent
42b8fe1683
commit
3c7b63d2e1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user