Is there an equivalent for the Zip function in Clojure Core or Contrib?

后端 未结 7 1922
野性不改
野性不改 2020-12-12 20:13

In Clojure, I want to combine two lists to give a list of pairs,

> (zip \'(1 2 3) \'(4 5 6))  
((1 4) (2 5) (3 6))

In Haskell or Ruby t

7条回答
  •  青春惊慌失措
    2020-12-12 20:27

    There is a function called zipmap, that may have the similar effect, (zipmap (1 2 3)(4 5 6)) The ouput is as fllows: {3 6, 2 5, 1 4}

提交回复
热议问题