Why not extend the main function with the "vec" function?
So based on the definition of split-at:
(defn split-at "Returns a vector of [(take n coll) (drop n coll)]" {:added "1.0" :static true} [n coll] [(take n coll) (drop n coll)])
We can add vec to each element of the vector result.
(defn split-at-vec [n coll] [(vec (take n coll)) (vec (drop n coll))])
Freed from βperformance penalties,β I think that when you turn your lazy words into a vector, you lose lazy productivity.
source share