Kevin Downey <redc...@gmail.com> writes: > (io/read [:lines :from <SOMETHING> :as p] > (do-stuff-with-a-string p)) > > (io/read [:lines :from <SOMETHING>]) ;no :as binding or body, results > in a lazy-seq of lines
And it's important to specify whether "p" in the former or the head item in the sequence in the latter remain valid after the next step to the next line. Though obviously easier to use, it annoys me when a line-by-line library function forces fresh allocation for every line. I'd like to see an option to reuse a buffer that holds the most-recently-read line, and stepping to the next line overwrites that buffer. The line offered is a read-only /view/ of the mutable buffer. "Saving" a line for future use hence requires an explicit copy -- something that's not likely idiomatic in Java or Clojure. -- Steven E. Harris -- 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