On Apr 16, 11:07 am, Jay Fields <j...@jayfields.com> wrote: > If you go down that path, I think vec > (http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/vec) > is worth looking at. > > I've always understood that vec turns lists into vectors, but leaves > vectors alone... which looks like what you are doing. > > good call, now I can use seq? instead to simplify the conditional
(defn lists->vectors "Replaces lists and lazy sequences with vectors" [obj] (let [f #(if (seq? %) (vec %) %)] (postwalk f obj))) -- 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