Hello, Can you give the exact REPL session, with the exception you have, and also the clojure version you're using ?
8/31 wangzx <wangzaixi...@gmail.com> > > I just want to learn clojure by using it to parse log file and > generate reports. and one question is: for a large text file, can we > use it as a sequence effectively? for example, for a 100M log file, we > need to check each line for some pattern match. > > I just using the (line-seq rdr) but it will cause > OutOfMemoryException. > > demo code > > (defn buffered-reader [file] > (new java.io.BufferedReader > (new java.io.InputStreamReader > (new java.io.FileInputStream file)))) > > (def -reader (buffered-reader "test.txt")) > (filter #(= "some" %) -reader) > > even there is no lines match "some", the filter operation will cause > OutOfMemoryException. > > Is there other APIs like the Sequence but provide stream-like API? > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---