comparison clojure/com/aurellem/vbm.clj @ 73:8a895ed4c0f9

added history facilities
author Robert McIntyre <rlm@mit.edu>
date Thu, 08 Mar 2012 04:37:10 -0600
parents c88ad4f6d9b4
children e8855121f413
comparison
equal deleted inserted replaced
72:c88ad4f6d9b4 73:8a895ed4c0f9
44 [buttons] 44 [buttons]
45 (loop [fixed [] 45 (loop [fixed []
46 pending buttons] 46 pending buttons]
47 (if (empty? pending) fixed 47 (if (empty? pending) fixed
48 (let [mask (first pending)] 48 (let [mask (first pending)]
49 (if (contains? (first pending) :reset) 49 (if (contains? (set (first pending)) :reset)
50 (recur (conj fixed mask) (drop 3 pending)) 50 (recur (conj fixed mask) (drop 3 pending))
51 (recur (conj fixed mask) (next pending))))))) 51 (recur (conj fixed mask) (next pending)))))))
52 52
53 (def vbm-header 53 (def vbm-header
54 (byte-array 54 (byte-array
86 vbm-trailer))] 86 vbm-trailer))]
87 contents)) 87 contents))
88 88
89 (defn write-vbm [buttons #^File out] 89 (defn write-vbm [buttons #^File out]
90 (clojure.java.io/copy (buttons->vbm-bytes buttons) out)) 90 (clojure.java.io/copy (buttons->vbm-bytes buttons) out))
91
92
93
94
95