Mercurial > cortex
comparison org/util.org @ 151:aaacf087504c
refactored vision code
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 03 Feb 2012 05:52:18 -0700 |
parents | b591da250afc |
children | c95179907951 |
comparison
equal
deleted
inserted
replaced
150:e1232043656a | 151:aaacf087504c |
---|---|
194 (println www)) | 194 (println www)) |
195 (apply-map demo {:www \"hello!\"}) | 195 (apply-map demo {:www \"hello!\"}) |
196 -->\"hello\"" | 196 -->\"hello\"" |
197 [fn m] | 197 [fn m] |
198 (apply fn (reduce #(into %1 %2) [] m))) | 198 (apply fn (reduce #(into %1 %2) [] m))) |
199 | |
200 (defn map-vals | |
201 "Transform a map by applying a function to its values, | |
202 keeping the keys the same." | |
203 [f m] (zipmap (keys m) (map f (vals m)))) | |
204 | |
205 | |
199 | 206 |
200 #+end_src | 207 #+end_src |
201 | 208 |
202 #+results: util | 209 #+results: util |
203 : #'cortex.util/apply-map | 210 : #'cortex.util/apply-map |