On Aug 31, 10:44 am, wangzx <wangzaixi...@gmail.com> wrote: > 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.
You have to be quite careful to avoid "holding on to the head" of the sequence when you do this sort of thing. You can create a sequence of lines from a Reader (clojure.core/line-seq or duck-streams/read-lines) but you have to be careful that you deal with the sequence only through lazy functions such as "map", without keeping any references to the start of the sequence itself. -SS --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---