3 ms·
In Clojure, hash maps are functions of their keys. If you use keywords as keys, then keywords are also functions of maps. ({:a 1} :a) => 1 (:a {:a
by jkkramer 15y ago
In Clojure, hash maps are functions of their keys. If you use keywords as keys, then keywords are also functions of maps.
({:a 1} :a)
=> 1
(:a {:a 1})
=> 1
(map {2 4} [1 2 3])
=> (nil 4 nil)
(map {:a 1 :b 2 :c 3} [:a :b :c])
=> (1 2 3)
- emilis_info 15y agoThank you! One more reason to use Clojure...