store/[org.clojure/clojure "1.8.0"] clj::clojure.core/to-array-2d

Official Documentation

Add notes
Arities
==================================================
   [coll]

Docstring
==================================================
  Returns a (potentially-ragged) 2-dimensional array of Objects
  containing the contents of coll, which can be any Collection of any
  Collection.

Source

(defn to-array-2d
  "Returns a (potentially-ragged) 2-dimensional array of Objects
  containing the contents of coll, which can be any Collection of any
  Collection."
  {:tag "[[Ljava.lang.Object;"
   :added "1.0"
   :static true}
  [^java.util.Collection coll]
    (let [ret (make-array (. Class (forName "[Ljava.lang.Object;")) (. coll (size)))]
      (loop [i 0 xs (seq coll)]
        (when xs
          (aset ret i (to-array (first xs)))
          (recur (inc i) (next xs))))
      ret))

Example 1

Edit
(def a (to-array-2d [[1 2 3] [4 5 6]]))
;; => #'user/a

(alength a)
;; => 2

(alength (aget a 0))
;; => 3

(aget a 0 0)
;; => 1

(aget a 0 1)
;; => 2

(aget a 0 2)
;; => 3

(aget a 1 0)
;; => 4

(aget a 2 0)
;; => ERROR

Example 2

Edit
;; quick example of a ragged array where the length of each element of the 
;; 2d array is unique

(def a (to-array-2d [[0] [1 2] [3 4 5] [6 7 8 9]]))
;; => #'user/a

(map alength [(aget a 0) (aget a 1) (aget a 2)])
;; => (1 2 3)

Uses on crossclj