This seems bad, is this bad:

(defn to-db
  [conn]
  (fn
     ([val] (upload-to-my-db conn val))
     ([_ val] (upload-to-my-db conn val)))

(defn -main []
  (transduce my-preprocessing-xf (to-db (get-db-conn)) seq-of-things-to-
preprocess-and-upload))

I ask only because
1) Plugging the side-effecting part into the transducer pipeline seems 
cleaner and potentially more efficient than e.g. 
(doseq [v (sequence my-preprocessing-xf sea-of-things)] (upload-to-my-db 
conn v))
which is what I was doing
2) The addition of `run!`[1] in 1.7 seems to perhaps implicitly condone 
this kind of thing. There's very little out there about it, though, so I 
could very well be wrong.




[1] 
http://conj.io/store/v1/org.clojure/clojure/1.7.0-alpha4/clj/clojure.core/run%21

-- 
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/d/optout.

Reply via email to