Created
September 29, 2012 12:35
-
-
Save jaycfields/3803875 to your computer and use it in GitHub Desktop.
blog entry for no anonymous functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def jay {:name "jay fields" :employer "drw.com" :current-city "new york"}) | |
(def john {:name "john dydo" :employer "drw.com" :current-city "new york"}) | |
(def mike {:name "mike ward" :employer "drw.com" :current-city "chicago"}) | |
(def chris {:name "chris george" :employer "thoughtworks.com" :current-city "new york"}) | |
[jay john mike chris] | |
[{:name "jay fields", :current-city "new york", :employer "drw.com"} | |
{:name "john dydo", :current-city "new york", :employer "drw.com"} | |
{:name "mike ward", :current-city "chicago", :employer "drw.com"} | |
{:name "chris george", :current-city "new york", :employer "thoughtworks.com"}] | |
(->> [jay john mike chris] | |
(map (juxt :employer (comp list :name))) | |
(map (partial apply hash-map)) | |
(apply merge-with concat)) | |
{"thoughtworks.com" ("chris george"), "drw.com" ("jay fields" "john dydo" "mike ward")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment