RosettaCodeData/Task/Knuths-algorithm-S/Clojure/knuths-algorithm-s-3.clj
2023-07-01 13:44:08 -04:00

5 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)))))