Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created October 11, 2012 23:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/0864360312f804c37cd9 to your computer and use it in GitHub Desktop.
Save amalloy/0864360312f804c37cd9 to your computer and use it in GitHub Desktop.
(let [data [{:g 1} {:v "bar"} {:v "qux"} {:g 2} {:v "quux"}]]
(into {}
(for [[g vs] (partition 2
(partition-by keys data))]
{(:g (first g)) (map :v vs)})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment