• (flatten x)
DEPRECATED. Prefer clojure.core version.
Takes any nested combination of sequential things (lists, vectors,
etc.) and returns their contents as a single, flat sequence.
(flatten nil) returns nil.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/seq.clj:35 top

(defn flatten
  "DEPRECATED. Prefer clojure.core version.
  Takes any nested combination of sequential things (lists, vectors,
  etc.) and returns their contents as a single, flat sequence.
  (flatten nil) returns nil."
  {:deprecated "1.2"}
  [x]
  (filter (complement sequential?)
          (rest (tree-seq sequential? seq x))))
Vars in clojure.contrib.seq/flatten: complement defn filter flatten rest seq sequential? tree-seq
Used in 0 other vars

Comments top

No comments for flatten. Log in to add a comment.