function | since v0.0-927 | clojure.core/flatten | Edit |
(flatten x)
Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence.
(flatten nil)
returns nil.
Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence. (flatten nil) returns nil.
(defn flatten
[x]
(filter #(not (sequential? %))
(rest (tree-seq sequential? seq x))))