frequenciesinの実装は次のclojureとおりです。
(defn frequencies
"Returns a map from distinct items in coll to the number of times
they appear."
[coll]
(persistent!
(reduce (fn [counts x]
(assoc! counts x (inc (get counts x 0))))
(transient {}) coll)))
assoc!突然変異と見なされますか?
assoc!内部の複雑さはfrequencies?
またcounts、各反復で 2 回アクセスされているようです: パフォーマンスが低下しますか?