# HG changeset patch # User Robert McIntyre # Date 1332752599 18000 # Node ID 2b6bd03feb4f5f744e1b6a9d8831a238a07be126 # Parent 40b5bff9576cd828057f9ed1b72ae9487f948571 minor correction. diff -r 40b5bff9576c -r 2b6bd03feb4f clojure/com/aurellem/gb/hxc.clj --- a/clojure/com/aurellem/gb/hxc.clj Mon Mar 26 03:50:17 2012 -0500 +++ b/clojure/com/aurellem/gb/hxc.clj Mon Mar 26 04:03:19 2012 -0500 @@ -331,24 +331,26 @@ "Returns all the maps that make the same associations as proto-map." (some (partial submap? proto-map) maps)) -;; (I don't use this for anything so far.) -;; -;; (defn filter-vals -;; "Returns a map consisting of all the pairs [key val] for which (pred -;; key) returns true." -;; [pred map] -;; (reduce (partial apply assoc) {} (filter (fn [[k v]] (pred v)) map))) +(defn filter-vals + "Returns a map consisting of all the pairs [key val] for + which (pred key) returns true." + [pred map] + (reduce (partial apply assoc) {} + (filter (fn [[k v]] (pred v)) map))) (defn search-moves - "Returns a subcollection of all hardcoded moves with the given - attributes. Attributes consist of :name :power :accuracy :pp :fx-id - (and also :fx-txt, but it contains the same information as :fx-id)" + "Returns a subcollection of all hardcoded moves with the + given attributes. Attributes consist of :name :power + :accuracy :pp :fx-id + (and also :fx-txt, but it contains the same information + as :fx-id)" ([attribute-map] - (search-moves com.aurellem.gb.gb-driver/original-rom attribute-map)) + (search-moves + com.aurellem.gb.gb-driver/original-rom attribute-map)) ([rom attribute-map] - (filter-vals (partial submap? attribute-map) (hxc-move-data - rom)))) + (filter-vals (partial submap? attribute-map) + (hxc-move-data rom))))