Hacker News new | ask | show | jobs
by emidln 3156 days ago
Fwiw, you can map over Maps and Strings in clojure:

    (map identity "foo")  ;; a seq for String is its chars
    ;=> (\f \o \o)
    
    (map identity {:foo :bar}) ;; a seq of a Map is the
                               ;; pairs of key/values
    ;=> ([:foo :bar])
1 comments

And get works on more types, like vectors. It also returns nil instead of throwing:

    cljs.user=> (get [:x :y :z] 1)
    :y
    cljs.user=> (get 5 :x)
    nil