3 ms·
Interesting, I've read Let over Lambda cover to cover 2-3 years ago and I don't even remember a chapter on reader macros. I wonder how many of the concepts of
by Flow 12y ago
Interesting, I've read Let over Lambda cover to cover 2-3 years ago and I don't even remember a chapter on reader macros.
I wonder how many of the concepts of let surrounding a lambda et al would work in Clojure since it uses immutability?
- mej10 12y agoThere is a lot less of the unrestrained use of mutability in Clojure, but you can still have shared mutable references via atoms and refs. 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))))