On 3 Apr 2015, at 3:14, Colin Yates wrote:
> Do you have any references to OSGi and Clojure?
My fork of clojure.osgi is updated for 1.6 and in Maven Central:
https://github.com/talios/clojure.osgi
and a simple demo:
https://github.com/talios/clojure.osgi.demo
( read: very very simple ).
We'v
I use partial for a sort-of-similar scenario. It gets you a reasonable way
there without adding any real complexity.
(defn do-stuff [db coll m]
(let [update (partial update db coll)
insert (partial insert db coll)]
(insert m)
(update m)
...))
You could wrap it with a macro
If you're from Poznań you might want to reach out to those guys on twitter
or something - http://nukomeet.com - they seem to be using Clojure (among
others) and have an office in the city.
On Thursday, 9 April 2015 22:33:39 UTC+2, Krzysztof Władyka wrote:
>
> Hello,
>
> I am learning Clojure.
>
Also keep in mind that a dynamically-bound variable is global state,
even if it's unbound by default. You might want to keep your library as
simple and possible and just pass it as the first argument. That also
greatly simplifies usage with Stuartsierra's component design.
A `with-connection' mac
The usual way to do this is via dynamic vars, e.g.
(def ^:dynamic *conn*)
(defmacro with-connection [conn & body]
`(binding [*conn* conn] ~@body))
(defn insert [m]
(db/insert *conn* m))
But while this approach removes repetition, it also adds complexity. It's
harder to c
I'm working with Monger[1], and have been thinking about connection
encapsulation. I've currently got a `myproject.mongo` ns with private `db`
and `coll` vars. I've got a public `insert` method along the lines of
(defn insert [m] (mc/insert db coll m))
where `mc/insert` is, perhaps unsurprisin
thanks!
On Saturday, April 11, 2015 at 5:15:06 PM UTC+2, David Nolen wrote:
> Yep, the clojure.main option is the one you want.
>
>
> David
>
>
> On Sat, Apr 11, 2015 at 10:45 AM, Georgi Danov wrote:
> I did read it very carefully several times, but kept trying to use it via
> remote connect