vector - Clojure: transform list of pairs/n-tuples into n-tuple of lists -


this question has answer here:

given list of n-tuple,

[[1, "a"], [2, "b"], [3, "c"]] 

i obtain

[[1, 2, 3]["a", "b", "c"]] 

i think available function in std. library, in python zip(*lst). not find unfortunately.

otherwise guess can come implementation using reduce, etc. prefer standard clojure function :)

(apply map vector [[1, "a"], [2, "b"], [3, "c"]]) 

if need vector can use mapv:

(apply mapv vector [[1, "a"], [2, "b"], [3, "c"]]) 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -