cfunction
src/core/array.c on line 245 , column 1
(array/concat arr & parts )
Concatenates a variable number of arrays (and tuples ) into the
first argument , which must be an array. If any of the parts are
arrays or tuples , their elements will be inserted into the array.
Otherwise , each part in `parts` will be appended to `arr` in order.
Return the modified array `arr` .
# Flatten single level of nested collections
(def foo [ [[1 2 ] [3 4 ]]
[[5 6 ] [7 8 ]] ])
(apply array/concat @[] foo ) # => @[(1 2) (3 4) (5 6) (7 8)]
(def a @[1 2 ])
(def b @[1 2 ])
( a b ) # => false
(def a @[1 2 ])
(def b (array/concat a 3 ))
a # => @[1 2 3]
b # => @[1 2 3]
( a b ) # => true
(def a @[1 2 ])
(array/concat a 3 [4 5 ] @[6 7 ] [] @[] 8 )
a # => @[1 2 3 4 5 6 7 8]