concat

added
1.0

ns
clojure.core

type
function

(concat) (concat x) (concat x y) (concat x y & zs)

Returns a lazy seq representing the concatenation of the elements in the supplied colls.

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

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

user=> (concat [:a :b] nil [1 [2 3] 4])
(:a :b 1 [2 3] 4)

=> (concat [1] [2] '(3 4) [5 6 7] #{9 10 8})
(1 2 3 4 5 6 7 8 9 10)
;; The last three elements might appear in a different order.

            
                user=> (concat "abc" "def")
(\\a \\b \\c \\d \\e \\f)

            
                user=> (apply concat '(([1 2]) ([3 4] [5 6]) ([7 8])))
([1 2] [3 4] [5 6] [7 8])

            
                user=> (concat '(1 2 3) '(4 5 6))
;; (1 2 3 4 5 6)
            
                user=> (concat [1 2 3] [4 5 6])
;; (1 2 3 4 5 6)
            
                (concat {:a "A" :b "B" :c "C"} {:d "D" :e "E"})
;; ([:a "A"] [:b "B"] [:c "C"] [:d "D"] [:e "E"])