function | since v0.0-927 | clojure.core/into | Edit |
(into)
(into to)
(into to from)
(into to xform from)
Returns a new collection consisting of to
with all of the items of from
"added" using conj
.
A transducer may be supplied as xform
.
Returns a new coll consisting of to-coll with all of the items of from-coll conjoined. A transducer may be supplied.
(defn into
([] [])
([to] to)
([to from]
(if-not (nil? to)
(if (implements? IEditableCollection to)
(-with-meta (persistent! (reduce -conj! (transient to) from)) (meta to))
(reduce -conj to from))
(reduce conj to from)))
([to xform from]
(if (implements? IEditableCollection to)
(let [tm (meta to)
rf (fn
([coll] (-> (persistent! coll) (-with-meta tm)))
([coll v] (conj! coll v)))]
(transduce xform rf (transient to) from))
(transduce xform conj to from))))