On Sun, Jan 15, 2012 at 01:37, James Reeves <jree...@weavejester.com> wrote:
> On 14 January 2012 23:34, myriam abramson <labwor...@gmail.com> wrote:
>> I couldn't find quite the equivalent to read-lines from duck-streams. I
>> found read-line but it's not the same. Where is the equivalent read-lines
>> outside of clojure.contrib?
>
> There's clojure.core/line-seq, but it doesn't close the reader when
> the seq finishes.

That's true; You're expected to scope this yourself:

(with-open [reader (something-that-produces-a-buffered-reader)]
    (something-that-consumes-line-sequence (line-seq reader)))

If you can't structure the computation this way because you're not
sure when or if you'll be consuming the sequence produced by line-seq,
then this becomes a hard problem.

// ben

-- 
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