RosettaCodeData/Task/Knuths-algorithm-S/Clojure/knuths-algorithm-s-3.clj

6 lines
155 B
Clojure

(defn s-of-n-creator [n]
(let [state (atom [[] 0])
s-of-n-fn (s-of-n-fn-creator n)]
(fn [item]
(first (swap! state s-of-n-fn item)))))