What are the benefits of using keywords as keys on maps in Clojure?

I noticed that Clojure usually uses keywords as keys on a map, while in other languages ​​that don't have this concept, they usually use strings.

What are the benefits of using keywords instead of strings or other types?

+4
source share
1 answer

let :

(let[{:keys [foo bar]} {:foo 1 :bar 30}]
  (+ foo bar)) ;;=>31

, :strs.

+5

Source: https://habr.com/ru/post/1619689/


All Articles