list

function/macrosince v0.0-927 clojure.core/listEdit
(list & xs)

Details:

Creates a new list containing items.


See Also:


Source docstring:
Creates a new list containing the items.
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn list
  [& xs]
  (let [arr (if (and (instance? IndexedSeq xs) (zero? (.-i xs)))
              (.-arr xs)
              (let [arr (array)]
                (loop [^not-native xs xs]
                  (if-not (nil? xs)
                    (do
                      (.push arr (-first xs))
                      (recur (-next xs)))
                    arr))))]
    (loop [i (alength arr) r ()]
      (if (> i 0)
        (recur (dec i) (-conj r (aget arr (dec i))))
        r))))

Macro code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro list
  ([]
   '(.-EMPTY cljs.core/List))
  ([x]
   `(cljs.core/List. nil ~x nil 1 nil))
  ([x & xs]
   (core/let [cnt (core/inc (count xs))]
     `(cljs.core/List. nil ~x (list ~@xs) ~cnt nil))))