|
|
@ -3,13 +3,13 @@
|
|
|
|
(= {} (hash-map))
|
|
|
|
(= {} (hash-map))
|
|
|
|
|
|
|
|
|
|
|
|
"Maps in clojure associate keys with values"
|
|
|
|
"Maps in clojure associate keys with values"
|
|
|
|
(= __ (.size (hash-map)))
|
|
|
|
(= __ (count (hash-map)))
|
|
|
|
|
|
|
|
|
|
|
|
"A value must be supplied for each key"
|
|
|
|
"A value must be supplied for each key"
|
|
|
|
(= {:a 1} (hash-map :a __))
|
|
|
|
(= {:a 1} (hash-map :a __))
|
|
|
|
|
|
|
|
|
|
|
|
"The size is the number of entries"
|
|
|
|
"The size is the number of entries"
|
|
|
|
(= __ (.size {:a 1 :b 2}))
|
|
|
|
(= __ (count {:a 1 :b 2}))
|
|
|
|
|
|
|
|
|
|
|
|
"You can look up the value for a given key"
|
|
|
|
"You can look up the value for a given key"
|
|
|
|
(= __ (get {:a 1 :b 2} :b))
|
|
|
|
(= __ (get {:a 1 :b 2} :b))
|
|
|
|