Re: Any chance of a module system being added to the language?

2015-04-12 Thread Mark Derricutt
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

Re: code-rewriting "with-connection" macro (monger and maybe beyond?)

2015-04-12 Thread Sam Roberton
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

Re: Poland - Poznań - i am looking people who are coding in Clojure to share experience

2015-04-12 Thread Tomek Mańko
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. >

Re: code-rewriting "with-connection" macro (monger and maybe beyond?)

2015-04-12 Thread Moritz Ulrich
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

Re: code-rewriting "with-connection" macro (monger and maybe beyond?)

2015-04-12 Thread James Reeves
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

code-rewriting "with-connection" macro (monger and maybe beyond?)

2015-04-12 Thread Sam Raker
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

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-3196, Conditional Reading, REPLs, and Code Motion

2015-04-12 Thread Georgi Danov
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