On 04.05.2013 12:16, Korny Sietsma wrote: > What's the idiomatic way to avoid this? The options seem to be either > to use > (doall (map parse-record records)) > or (mapv parse-record records) > > Is either of these better? The latter is simpler, the former (to me) > expresses that you are deliberately forcing non-laziness. Or is there > some other alternative?
`doall` is idiomatic. As you said, `mapv` tells the reader that you need the result to be a vector (you don't) while leaving implicit the fact that you want to force the evaluation of the sequence, so it's confusing in two ways. If you don't care about the return values of the `save-result!` calls, the best way is to use `doseq` to iterate over the records: (defn parse-and-store [raw-data] (try (save-audit-data! raw-data) (let [records (split-records raw-data) results (map parse-record records)] (doseq [result results] (save-result! result))) (catch Exception e (save-error-data! raw-data e)))) -- Timo -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.