by Flow · 11y ago · 0 comments
I wonder how many of the concepts of let surrounding a lambda et al would work in Clojure since it uses immutability?
EDIT:
As an example, here is the block-scanner in Clojure:
(defn block-scanner [trig]
(let [curr (atom trig)]
(fn [data]
(doseq [c data]
(if (not (empty? @curr))
(reset! curr
(if (= (first @curr) c)
(rest @curr)
trig))))
(empty? @curr))))