Idiomatic clojure map lookup by keyword

后端 未结 4 872
忘了有多久
忘了有多久 2020-11-29 08:09

Say I have a clojure map that uses keywords as its keys:

(def my-car {:color \"candy-apple red\" :horsepower 450})

I know that I can look u

4条回答
  •  [愿得一人]
    2020-11-29 08:33

    I would say either is idiomatic. The only caveat is that the second form only works with keywords. Which, I assume by being a deliberate design choice, would give it more reason to be idiomatic.

提交回复
热议问题