Changes for clojure.core/repeatedly

philos99 on Tue, 04 Oct 2011
(defn counter []  
  (let [tick (atom 0)]
    #(swap! tick inc)))

(def tick (counter))

user=> (take 10 (repeatedly tick))
(1 2 3 4 5 6 7 8 9 10)
zkim on Sun, 26 Sep 2010
(defn counter []  
  (let [tick (atom 0)]
    #(swap! tick inc)))

(def tick (counter))

user=> (take 10 (repeatedly tick))
Jeff Rose on Fri, 03 Sep 2010
(defn counter []  
  (let [tick (atom 0)]
    #(swap! tick inc)))

(def tick (counter))

(take 10 (repeatedly tick))