function/macro | since v0.0-927 | clojure.core/vector | Edit |
(vector & args)
Creates a new vector containing args
.
Creates a new vector containing the args.
(defn vector
[& args]
(if (and (instance? IndexedSeq args) (zero? (.-i args)))
(.fromArray PersistentVector (.-arr args) (not (array? (.-arr args))))
(vec args)))
(core/defmacro vector
([] '(.-EMPTY cljs.core/PersistentVector))
([& xs]
(core/let [cnt (count xs)]
(if (core/< cnt 32)
`(cljs.core/PersistentVector. nil ~cnt 5
(.-EMPTY-NODE cljs.core/PersistentVector) (array ~@xs) nil)
(vary-meta
`(.fromArray cljs.core/PersistentVector (array ~@xs) true)
assoc :tag 'cljs.core/PersistentVector)))))