Mercurial > cortex
diff org/world.org @ 320:52de8a36edde
removed last vestiges of clojure.contrib
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 01 Mar 2012 06:24:17 -0700 |
parents | bb3f8a4af87f |
children | 939bcc5950b2 |
line wrap: on
line diff
1.1 --- a/org/world.org Thu Mar 01 05:56:52 2012 -0700 1.2 +++ b/org/world.org Thu Mar 01 06:24:17 2012 -0700 1.3 @@ -53,9 +53,6 @@ 1.4 driven exception handling" 1.5 {:author "Robert McIntyre"} 1.6 1.7 - (:use (clojure.contrib (def :only (defn-memo)))) 1.8 - (:use [clojure.contrib [str-utils :only [re-gsub]]]) 1.9 - 1.10 (:import com.aurellem.capture.IsoTimer) 1.11 1.12 (:import com.jme3.math.Vector3f) 1.13 @@ -153,7 +150,7 @@ 1.14 (defn integer-constants [class] 1.15 (filter static-integer? (.getFields class))) 1.16 1.17 -(defn-memo constant-map 1.18 +(defn constant-map 1.19 "Takes a class and creates a map of the static constant integer 1.20 fields with their names. This helps with C wrappers where they have 1.21 just defined a bunch of integer constants instead of enums" 1.22 @@ -162,6 +159,7 @@ 1.23 (into (sorted-map) 1.24 (zipmap (map #(.get % nil) integer-fields) 1.25 (map #(.getName %) integer-fields))))) 1.26 +(alter-var-root #'constant-map memoize) 1.27 1.28 (defn all-keys 1.29 "Uses reflection to generate a map of string names to jme3 trigger 1.30 @@ -170,7 +168,7 @@ 1.31 (let [inputs (constant-map KeyInput)] 1.32 (assoc 1.33 (zipmap (map (fn [field] 1.34 - (.toLowerCase (re-gsub #"_" "-" field))) (vals inputs)) 1.35 + (.toLowerCase (.replaceAll field "_" "-"))) (vals inputs)) 1.36 (map (fn [val] (KeyTrigger. val)) (keys inputs))) 1.37 ;;explicitly add mouse controls 1.38 "mouse-left" (MouseButtonTrigger. 0)