Why does concat on vectors evaluate to a list?

concat returns a lazy sequence.

user=> (doc concat)
-------------------------
clojure.core/concat
([] [x] [x y] [x y & zs])
  Returns a lazy seq representing the concatenation of the elements in the supplied colls.

you can convert it back to a vector with into:

user=> (into [] (concat [1 2] [3 4] [5 6]))
[1 2 3 4 5 6]

into uses transients so it’s pretty quick about it.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)