I don't know the reason for the current implementation rather than your suggested one, but at least on the comment about 0 or 1 arguments has a ticket for it:
http://dev.clojure.org/jira/browse/CLJ-863 Andy On Oct 3, 2012, at 11:03 AM, Marc Dzaebel wrote: > clojure.core/interleave could be implemented as: > > (defn interleave [& s] (apply mapcat list s)) > > rather than: > > (defn interleave > ([c1 c2] > (lazy-seq > (let [s1 (seq c1) s2 (seq c2)] > (when (and s1 s2) > (cons (first s1) (cons (first s2) > (interleave (rest s1) (rest s2)))))))) > ([c1 c2 & colls] > (lazy-seq > (let [ss (map seq (conj colls c2 c1))] > (when (every? identity ss) > (concat (map first ss) (apply interleave (map rest ss)))))))) > > Are there other reasons (e.g. performance), for the current implementation? > Otherwise, one should replace it. Even calling interleave with zero or one > argument would be possible. > > Thanks, Marc > > -- > 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 -- 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