2 ms·
Not sure I understand your comment. Is `accumulate` a scheme function? My comment was intended to say that Clojure vectors have some operations that are perfor
by loevborg 6y ago
Not sure I understand your comment. Is `accumulate` a scheme function?
My comment was intended to say that Clojure vectors have some operations that are performant and some that aren't. It is part of Clojure's philosophy to encourage the operations that are natural for the respective data type. `conj` appends to the end when applied to a vector but inserts at the head when applied to a list.
So you want to pick the appropriate data structure for the job and make sure only natural operations are used. For a vector appending is natural whereas inserting at the head is not.