Hi,

I came across this issue while implementing a lazy, efficient flatten that
also uses the whole sequence abstraction (flatten java arrays....).
The problem with (seq x) is, that it will throw an Exception if called on
something, that cannot be coerced to sequence, so I just used sequencial?
like the current implementation of flatten:

(defn my-flatten [coll]
  (mapcat (fn [p] (if (sequential? (first p)) (mapcat my-flatten p) p))
          (partition-by sequential? coll)))

But this will obviously fail  to flatten anything that doesn't
implement clojure.lang.Sequential (like java.arrays).

Jürgen

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to