Is there an alternative to a map to apply a function to all in sequence in Clojure?

I have a function

(defn change-score [docid termid] (do (dosync (alter *documents-scores* assoc docid (+ 1 (*documents-scores* docid)))) nil) ) (defn vector-space[] (loop [terms (count (deref *term-hash*))] (if (zero? terms) nil (do (dorun (map (fn[docid](change-score docid terms)) (doc-list terms))) (recur (dec terms)))))) 

Is there an alternative to the map in function?

+4
source share
1 answer

doseq is for this purpose.

 (doseq [x xs] (side-effect x)) 
+6
source

All Articles