Loops/While: Difference between revisions

m
Line 155:
(while (> @i 0)
(println @i)
(dosync (ref-set i (quot @i 2))))</lang>
 
2 ways without mutability:
 
<lang Clojure>(loop [i 1024]
(when (pos? i)
(println i)
Anonymous user