> Here is my function: > > (defn json-seq [] > (apply concat > (map #(do (print "f") (str/split (slurp %) #"\nStatusJSONImpl")) > out-files)))
Assuming the str namespace is clojure.contrib.string, (str/split ..) won't be lazy. Currently it's implemented as: (defn split "Splits string on a regular expression. Optional argument limit is the maximum number of splits." ([#^Pattern re #^String s] (seq (.split re s))) ([#^Pattern re limit #^String s] (seq (.split re s limit)))) So, while the sequence returned by concat would be lazy in and of itself, ultimately there will be the non-lazy return value of Pattern.split() in memory. Also, is it considered idiomatic to rely on lazyness in cases like this, anyone? -- / Peter Schuller -- 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