Re: Advice on introducing a Java dev to Clojure

2015-07-12 Thread Matt Bailey
Johanna, I noticed you mentioned CQRS. In my work, we use CQRS heavily, specifically the Axon framework for Java (utilizing Spring and Hibernate). I got into Clojure through watching Rich Hickey's talks and figured that any language that he wrote had to be good. It's remarkable to me how clean

Re: Advice on introducing a Java dev to Clojure

2015-07-12 Thread Colin Yates
My latest project uses a CQRS and event sourcing design and the power it gives, coupled with Clojure is just fantastic. Hydrating an object becomes (merge {} (event-store/load ar-id)) - just fantastic. I too find a lot of sympathy between CQRS, event sourcing, FRP and Clojure which I keep meani

Re: Advice on introducing a Java dev to Clojure

2015-07-12 Thread Colin Yates
I do of course mean (reduce merge {} (event-store/load ar-id)) or (apply merge (event-store/load ar-id)) :) > On 12 Jul 2015, at 16:21, Colin Yates wrote: > > My latest project uses a CQRS and event sourcing design and the power it > gives, coupled with Clojure is just fantastic. Hydrating an

Re: [ANN] suchwow: a grab-bag library with some twists

2015-07-12 Thread Colin Fleming
I just saw this the other day, in particular the better docstrings are great. See also Andy Fingerhut's Thalia project. I'm planning to provide doc from both of these in Cursive soon. On 12 July 2015 at 01:34, Brian Marick wrote: > https://github.com/maric

2 way transform in single definition ? unification ?

2015-07-12 Thread Jules
Guys, I have an external and an internal data representation. I need to define transforms both ways. Both models are structured. A pair of in/out functions might look like: (fn [{{b :b c c:} :a}] [b [c]]) (fn [[b [c]] {:a {:b b :c c}}) I just typed that OTTOMH so please forgive any mistakes.

How do I expand a variable that I pass to a macro?

2015-07-12 Thread Lynn Dylan Hurley
Here is what I'm trying to do: --- ;; route defined outside of the defroutes macro (def foo-route ["/" {:get foo-handler}]) (defroutes routes [[["/" ;; I'm trying to do this, but it does NOT work ["/foo" foo-route] ;; this does work ["/bar" ["/" {:get bar-handler}]]]

Re: [ANN] suchwow: a grab-bag library with some twists

2015-07-12 Thread Brian Marick
Colin Fleming wrote: I just saw this the other day, in particular the better docstrings are great. See also Andy Fingerhut's Thalia project. I'm planning to provide doc from both of these in Cursive soon. That does look nice. Wish I'd known of it earlie

Deprecation library

2015-07-12 Thread Brian Marick
Is there a library out there for deprecating functions? I'm looking for something that prints a deprecation message, but only once, allows deprecation messages to be turned off (probably from environment variable), and perhaps allows something other than `println` to be plugged in as the messag

Re: [ANN] suchwow: a grab-bag library with some twists

2015-07-12 Thread Daniel Compton
cljs.info have also done a heap of work on improving docstrings too. On Mon, 13 Jul 2015 at 9:15 AM Brian Marick wrote: > > > Colin Fleming wrote: > > I just saw this the other day, in particular the better docstrings are > > great. See also Andy Fingerhut's Thalia > >

Re: Deprecation library

2015-07-12 Thread Alex Kolov
Am Sonntag, 12. Juli 2015, 16:17:50 schrieb Brian Marick: > Is there a library out there for deprecating functions? I'm looking for > something that prints a deprecation message, but only once, allows > deprecation messages to be turned off (probably from environment > variable), and perhaps allows

Re: Deprecation library

2015-07-12 Thread Andy Fingerhut
Eastwood warns about deprecated Clojure functions and Java methods (among other things). https://github.com/jonase/eastwood#deprecations Andy On Sun, Jul 12, 2015 at 2:17 PM, Brian Marick wrote: > Is there a library out there for deprecating functions? I'm looking for > something that prin

Re: clojure don't support .clj source code file by utf-8.

2015-07-12 Thread Sungjin Chun
On Mac OS X (Yosemite) and Linux (Ubuntu), this code works well (I'm using en_US.UTF-8 as charset and encoding for my system). I suspect that the OS (Windows) or its configuration is the source of the problem. On Sunday, July 12, 2015 at 10:57:59 AM UTC+9, Denis Fuenzalida wrote: > > I was abl

Re: clojure don't support .clj source code file by utf-8.

2015-07-12 Thread Luc Prefontaine
Windows a problem ? N, impossible :))) Luc P. Sent from my iPhone > On Jul 12, 2015, at 19:39, Sungjin Chun wrote: > > On Mac OS X (Yosemite) and Linux (Ubuntu), this code works well (I'm using > en_US.UTF-8 as > charset and encoding for my system). > > I suspect that the OS (Windows) o

Re: clojure don't support .clj source code file by utf-8.

2015-07-12 Thread Baishampayan Ghose
Hi, IIRC Windows requires UTF-8 encoded files to have the BOM (Byte Order Mark). Can you verify that your file has the BOM? Regards, BG On Thu, Jul 9, 2015 at 8:03 AM, Alex Woods wrote: > clojure don't support .clj source code file by utf-8. > it's ok when the .clj source code files by ascii >

Re: clojure don't support .clj source code file by utf-8.

2015-07-12 Thread Avi Avicenna
I followed steps described by Denis Fuenzalida in my Windows 7 machine and I can completely reproduce the results. So, in Windows 7, the solution is the .clj files must be saved with UTF-8 without BOM encoding. On Sunday, 12 July 2015 08:57:59 UTC+7, Denis Fuenzalida wrote: > > I was able to re

Re: How do I expand a variable that I pass to a macro?

2015-07-12 Thread Michael Blume
First of all, I'm pretty sure compojure will let you do the thing, because it's less macro-heavy than what you're using. But to answer the general question, this is a fundamental problem with macros. Once you're making heavy use of macros you start having to write more macros in order to compose t

Re: How do I expand a variable that I pass to a macro?

2015-07-12 Thread James Reeves
Simple macros are often sugar around functions. In Pedestal, defroutes appears to be defined as: (defmacro defroutes [name route-spec] `(def ~name (expand-routes (quote ~route-spec So you could use expand-routes and syntax quotes instead. - James On 12 July 2015 at 20:40, Lynn Dylan Hurle

Re: Updated Clojure cheatsheet, including new vars in Clojure 1.7.0

2015-07-12 Thread Andy Fingerhut
Thanks to Alex Miller, http://clojure.org/cheatsheet is now updated to the latest version of the cheat sheet, with links to ClojureDocs.org. The "Download other versions with tooltips" link near the top of that page links to here, as usual: http://jafingerhut.github.io where you can find the

Re: 2 way transform in single definition ? unification ?

2015-07-12 Thread craig worrall
You may have already discounted Java versions, but just in case ... http://www.javacodegeeks.com/2013/10/java-object-to-object-mapper.html Craig On Monday, July 13, 2015 at 3:53:19 AM UTC+10, Jules wrote: > > Guys, > > I have an external and an internal data representation. > > I need to define

Re: clojure don't support .clj source code file by utf-8.

2015-07-12 Thread Sungjin Chun
Of course not. My files do not have BOM. So the problem lies in the BOM thingy? On Mon, Jul 13, 2015 at 10:07 AM Baishampayan Ghose wrote: > Hi, > > IIRC Windows requires UTF-8 encoded files to have the BOM (Byte Order > Mark). > Can you verify that your file has the BOM? > > Regards, > BG > > O