Returns an array of Objects containing the contents of coll, which
can be any Collection. Maps to java.util.Collection.toArray().
(def hello (to-array "Hello World!")) (aget hello 1) \e (aset hello 1 \b) ;;Mutability! Watch out! \b (dotimes [n (alength hello)] (print (aget hello n))) Hbllo World!
(defn to-array
"Returns an array of Objects containing the contents of coll, which
can be any Collection. Maps to java.util.Collection.toArray()."
{:tag "[Ljava.lang.Object;"
:added "1.0"
:static true}
[coll] (. clojure.lang.RT (toArray coll)))
Comments top
No comments for to-array. Log in to add a comment.