On Jan 20, 3:32 pm, Mark Volkmann <[email protected]> wrote:
> Can someone describe a situation where it is preferable to use doall
> instead of dorun?
Here's one:
(defn read-my-file []
(with-open [reader (BufferedReader. (FileReader. "my-file.txt"))]
(doall (line-seq reader))))
"line-seq" returns a lazy sequence, but you have to consume that
sequence before "with-open" closes the file.
-Stuart Sierra
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---