Awesome, thank you so much.
Is there any way to make it lazy to avoid the dreaded outOfMemoryError ? Or
is it already lazy and I'm not seeing it / working with it properly?
Best,
--Joseph
On Friday, June 22, 2012 7:30:28 AM UTC-5, Walter Tetzner wrote:
>
>
>
> On Friday, June 22, 2012 8:28:02 AM UTC-4, Walter Tetzner wrote:
>>
>>
>> (defn read-records
>> "Read the data from the given reader as a list of strings, where
>> each string is made up of multiple lines, separated by // on it's own
>> line."
>> [reader]
>> (->> (line-seq reader)
>> (partition-by #{["//"]})
>> (filter (comp not #{["//"]}))
>> (map (partial apply str))))
>>
>
> Actually, you want the new lines:
>
> (defn read-records
> "Read the data from the given reader as a list of strings, where
> each string is made up of multiple lines, separated by // on it's own
> line."
> [reader]
> (->> (line-seq reader)
> (partition-by #{["//"]})
> (filter (comp not #{["//"]}))
> (map (partial clojure.string/join "\n"))))
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en