comparison clojure/com/aurellem/gb/util.clj @ 314:073600cba28a

scroll text works robustly but is slow
author Robert McIntyre <rlm@mit.edu>
date Mon, 02 Apr 2012 20:30:02 -0500
parents 5bcda2d6d135
children d263df762c59
comparison
equal deleted inserted replaced
313:8e63b0bb8ea3 314:073600cba28a
145 (set-memory-range 145 (set-memory-range
146 @current-state start values))) 146 @current-state start values)))
147 147
148 (defn common-differences [& seqs] 148 (defn common-differences [& seqs]
149 (let [backbone (range (count (first seqs)))] 149 (let [backbone (range (count (first seqs)))]
150 (filter 150 (sort-by
151 (comp (partial apply distinct?) second) 151 first
152 (zipmap backbone 152 (filter
153 (apply (partial map list) seqs))))) 153 (comp (partial apply distinct?) second)
154 (zipmap backbone
155 (apply (partial map list) seqs))))))
154 156
155 (defn temporal-compare [& states] 157 (defn temporal-compare [& states]
156 (apply common-differences 158 (apply common-differences
157 (map (comp vec memory) 159 (map (comp vec memory)
158 states))) 160 states)))