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

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -