Skip to content

Instantly share code, notes, and snippets.

@raspasov
Created February 1, 2015 04:36
Show Gist options
  • Save raspasov/499b9aa5d0b0d0b91bf8 to your computer and use it in GitHub Desktop.
Save raspasov/499b9aa5d0b0d0b91bf8 to your computer and use it in GitHub Desktop.
;looking to transform:
(def x ([14227624954630003 3] [14227624954630004 4] [14227624954630005 5] [14227624954630006 6]))
;... into:
[[14227624954630003 14227624954630004 14227624954630005 14227624954630006] [3 4 5 6]]
;anything more idiomatic than:
(reduce (fn [result new]
[(conj (nth result 0) (nth new 0))
(conj (nth result 1) (nth new 1))]) [[] []] x)
;?
;thanks :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment