matrix transposition in clojure

Solution 1:

The usual solution is

(defn transpose [m]
  (apply mapv vector m))

Solution 2:

As of 2014, I would recommend using core.matrix for any numerical work in Clojure.

Among other things, this provides implementations of all the most common matrix operations:

(use 'clojure.core.matrix)

(transpose [[1 2] [3 4]])
=> [[1 3] [2 4]]