into

functionsince v0.0-927 clojure.core/intoEdit
(into)
(into to)
(into to from)
(into to xform from)

Details:

Returns a new collection consisting of to with all of the items of from "added" using conj.

A transducer may be supplied as xform.


See Also:


Source docstring:
Returns a new coll consisting of to-coll with all of the items of
from-coll conjoined. A transducer may be supplied.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(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))))