Posts by Alan Thompson • 166 points
1 post
-
5
votes1
answer120
viewsA: Variable in Clojure
A simple way is to use one atom to maintain the current value: (def cnt (atom 0)) (doseq [i (range 5) ] (swap! cnt inc) (println "value=" @cnt)) value= 1 value= 2 value= 3 value= 4 value= 5 Behold…
clojureanswered Alan Thompson 166