comparison org/util.org @ 153:c95179907951

saving progress
author Robert McIntyre <rlm@mit.edu>
date Fri, 03 Feb 2012 05:59:32 -0700
parents aaacf087504c
children 33278bf028e7
comparison
equal deleted inserted replaced
152:c901b17a1f52 153:c95179907951
201 "Transform a map by applying a function to its values, 201 "Transform a map by applying a function to its values,
202 keeping the keys the same." 202 keeping the keys the same."
203 [f m] (zipmap (keys m) (map f (vals m)))) 203 [f m] (zipmap (keys m) (map f (vals m))))
204 204
205 205
206
207 #+end_src 206 #+end_src
208 207
209 #+results: util 208 #+results: util
210 : #'cortex.util/apply-map 209 : #'cortex.util/apply-map
211 210
213 *** Creating Basic Shapes 212 *** Creating Basic Shapes
214 213
215 #+name: shapes 214 #+name: shapes
216 #+begin_src clojure :results silent 215 #+begin_src clojure :results silent
217 (in-ns 'cortex.util) 216 (in-ns 'cortex.util)
217
218 (defn load-bullet
219 "Runnig this function unpacks the native bullet libraries and makes
220 them available."
221 []
222 (let [sim (world (Node.) {} no-op no-op)]
223 (doto sim
224 (.enqueue
225 (fn []
226 (.stop sim)))
227 (.start))))
228
218 229
219 (defrecord shape-description 230 (defrecord shape-description
220 [name 231 [name
221 color 232 color
222 mass 233 mass