我真的很想知道为什么vector的实现如此冗长?它不能做的原因是什么[],[a]并且[a & args]?
这是我得到的clj-1.4.0.
=> (source vector)
(defn vector
"Creates a new vector containing the args."
{:added "1.0"
:static true}
([] [])
([a] [a])
([a b] [a b])
([a b c] [a b c])
([a b c d] [a b c d])
([a b c d & args]
(. clojure.lang.LazilyPersistentVector (create (cons a (cons b (cons c (cons d args))))))))
nil
Run Code Online (Sandbox Code Playgroud) clojure ×1