From f0e3b985d0ab01fff2ba58fe7b3e55b7889ff51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20M=2E=20Valenzuela?= Date: Thu, 10 May 2012 14:13:15 +0300 Subject: [PATCH] fixed unsafe idiom. see: http://blog.darevay.com/2011/10/clojure-update-literacy/ --- src/clj_automata/core.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clj_automata/core.clj b/src/clj_automata/core.clj index d5d2803..d65293a 100644 --- a/src/clj_automata/core.clj +++ b/src/clj_automata/core.clj @@ -145,7 +145,7 @@ ;; Our initial state is a single row of random 0s and 1s initial (repeatedly height #(rand-int 2)) sim (simulation (rule rule-num) initial) - ;; We use partition as a sliding wintdow here. Since sim is + ;; We use partition as a sliding window here. Since sim is ;; an infinite lazy sequence of future rows we use the 3-arity ;; version of partition here to create a 2D view of the visible range ;; of results. Since this is the 3-arity version of partition, with 1 @@ -168,7 +168,7 @@ ;; tail recursive loop and not-utilizing the draw callback, but that's left ;; as an excercise for the reader. (draw-buffer (first @time-slices) scale) - (swap! time-slices (fn [_] (rest @time-slices)))) + (swap! time-slices rest)) :size [(* scale width) (* scale height)]))) (defn -main [rule-num & args]