Why does `vector` implementation have multiple cases?
问题 Here's clojure's definition of 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)))))))) Why are there so many cases? Or, if there are so many, why aren't there more? My guess is that it's striking a balance between implementation efficiency and probability, but I don't quite see