Semantically speaking, some properties of a Map are impossible to project to functions. Maps have count of elements, maps allow enumerating all elements they contain, this is not possible to do with functions.
Another downside I see is unpredictable complexity of get
. Currently when calling get
on a map, you can expect operation to be reasonbly fast. In case of (get itentity 1000)
it holds, in case of (get #(do (Thread/sleep %) %) 1000)
it doesn't. I like Clojure's predictable execution times, such as with conj
, that is guaranteed to be O(1), while not guaranteeing item will be inserted into an end of a coll.