3 ms·
(Author here) Thanks for the time you put into your comment. I think there may be both advantages and disadvantages in unifying function calls and dictionary q
by emilis_info 15y ago
(Author here) Thanks for the time you put into your comment.
I think there may be both advantages and disadvantages in unifying function calls and dictionary queries. The reason I am asking the question is that I haven't been able to try it for myself (or at least read about someones experience with it).
And I will try exposing myself to more languages :-)
- jkkramer 15y agoIn 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...