This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-29
Channels
- # announcements (7)
- # babashka (36)
- # beginners (67)
- # braveandtrue (11)
- # cider (8)
- # clojure (52)
- # clojure-conj (4)
- # clojure-poland (1)
- # clojure-spec (9)
- # clojure-uk (8)
- # clojurescript (42)
- # core-typed (11)
- # cursive (4)
- # emacs (1)
- # fulcro (1)
- # graalvm (24)
- # hoplon (10)
- # hyperfiddle (1)
- # off-topic (30)
- # re-frame (7)
- # reitit (1)
- # sql (1)
So, say you have a db connection and a function that uses that dB connection, would it be better to pass in that connection as a function argument and use it, or pass that db connection in, but return a function that can be used (e.g., to perform a select), in effect wrapping the db connection?
E.g., (defn [conn sql] (select conn sql....))
Versus (defn [conn] (fn[SQL] select conn SQL...)))
There's exceptions to this, for example where you're defining a standard library of particular calling convention (eg transducers)