Re: How to change map in doseq ?

2013-10-27 Thread Jiaqi Liu
Thanks for your suggests~ The above piece of code is just for test. The practical problem i want to solve is that -->read a very big log file (each line is like that : "user id, latitude, longitude, timeStamp") -->statistic the number of each user (store in a map like that { id1 100 , id2 200, id3

Re: ANN: print-foo - a library of print debugging macros

2013-10-27 Thread Alex Baranosky
I took some inspiration from Tim Baldridge's code-walking macro youtube video (http://www.youtube.com/watch?v=HXfDK1OYpco) and updated print-foo's `print-sexp` macro to intelligently expand the code it surrounds. print.foo=> (print-sexp (str (+ 3 4) (+ 5 (* 6 2)) 4))3 34 4(+ 3 4) 75 56 62 2(* 6 2)

Fast path to having fun with ClojureScript

2013-10-27 Thread David Nolen
Given the source map improvements to ClojureScript, now is a good time to present a newbie friendly guide to hacking with ClojureScript. Emphasis on no fuss and getting as quickly as possible to productive experimentation: http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/ --

Re: How to change map in doseq ?

2013-10-27 Thread Michael Klishin
2013/10/28 Jiaqi Liu > i really don't get it. > Any suggestion?? > Clojure data structures are immutable. clojure.core/assoc produces a new data structure instead of changing the one you have. You can use an atom if you need to update a map from doseq but more likely you want to use the actual

How to change map in doseq ?

2013-10-27 Thread Jiaqi Liu
Hi , all I am new to Clojure. For now , i have a piece of code : (let [res {}] (doseq [id [111 222 333] num [2 3 4]] (assoc res id num)) (count res)) i want to get the res {111 2 , 222 3 , 333 4} and count 3 but the repl return me {} and 0 i r

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Paul Samways
Hi Scott, I only began Clojure web development recently and decided to use Luminus [1]; it brings together a bunch of frameworks (lib-nior, ring, compojure, etc). Felt like a good starting point for me. Paul. [1] http://www.luminusweb.net/ On Mon, Oct 28, 2013 at 9:51 AM, James Reeves wrote:

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Paul Samways
Oh? What are the benefits of using those over Korma? I've been more than happy with it up to now. On Mon, Oct 28, 2013 at 10:30 AM, Alexander Hudek wrote: > http://www.luminusweb.net/ gives a reasonable starting setup. The only > thing I would recommend doing differently is to use clojure/java.j

Conj Schedule any time soon? EOM

2013-10-27 Thread Alex Miller
Yes, coming very soon. Alex -- -- 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 fro

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Christopher Allen
You can use Korma with Stuart Sierra's workflow just fine. On Sunday, October 27, 2013 5:07:02 PM UTC-7, Manuel Paccagnella wrote: > > Il giorno lunedì 28 ottobre 2013 00:30:06 UTC+1, Alexander Hudek ha > scritto: > > http://www.luminusweb.net/ gives a reasonable starting setup. The only >> thin

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Sean Corfield
I'm using FW/1 (but then it's my framework, ported from CFML :) which is based on Ring and uses Enlive and Selmer for templating. It uses conventions rather than configuration (although you can specify routes if you want to override configuration). https://github.com/framework-one/fw1-clj Sean

ANN: ClojureScript 0.0-1978

2013-10-27 Thread David Nolen
ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript New release version: 0.0-1978 Leiningen dependency information: [org.clojure/clojurescript "0.0-1978"] Changes: * tools.reader 0.7.10 Enhancements: * Sig

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Manuel Paccagnella
Il giorno lunedì 28 ottobre 2013 00:30:06 UTC+1, Alexander Hudek ha scritto: http://www.luminusweb.net/ gives a reasonable starting setup. The only > thing I would recommend doing differently is to use clojure/java.jdbc or > honeysql instead of korma for an sql dsl. > I agree. Korma is quite i

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Alexander Hudek
http://www.luminusweb.net/ gives a reasonable starting setup. The only thing I would recommend doing differently is to use clojure/java.jdbc or honeysql instead of korma for an sql dsl. On Sunday, October 27, 2013 1:43:21 PM UTC-4, Scott M wrote: > > Ring seems well maintained, but Noir and Comp

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread James Reeves
Compojure isn't deprecated. What made you think it was? - James On 27 October 2013 17:43, Scott M wrote: > Ring seems well maintained, but Noir and Compojure are marked deprecated. > > Can anyone lay out a Clojure Web library "stack" (up to templating) that > is current and maintained? > > Any

Re: What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Andy Fingerhut
Noir is deprecated in favor of lib-noir. Where have you seen some indication that Compojure is deprecated? Andy On Sun, Oct 27, 2013 at 10:43 AM, Scott M wrote: > Ring seems well maintained, but Noir and Compojure are marked deprecated. > > Can anyone lay out a Clojure Web library "stack" (up

What non-deprecated Clojure Web libraries to use?

2013-10-27 Thread Scott M
Ring seems well maintained, but Noir and Compojure are marked deprecated. Can anyone lay out a Clojure Web library "stack" (up to templating) that is current and maintained? Any and all sagacious wisdom greatly appreciated - thanks! - Scott -- -- You received this message because you are su

Re: get fn and not-found

2013-10-27 Thread Cedric Greevey
(get a-map :b my-foo) will result in the function object itself being returned if :b is not found. If you want it to be called only in the event of not found, you need either (if (contains? a-map :b) (a-map :b) (my-foo)) -- which may perform the lookup twice -- or (if-let [r (a-map :b)] r (my-foo

Conj Schedule any time soon? EOM

2013-10-27 Thread Tim Visher
Conj Schedule any time soon? EOM -- -- 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

Re: get fn and not-found

2013-10-27 Thread Ryan
Silly me, thank you for your replies guys! One more question though, what if my-foo had parameters? Ryan On Sunday, October 27, 2013 6:55:34 PM UTC+2, Luc wrote: > > You are getting my-foo evaluated, remove the parens around it. > > Luc P. > > > > Hello, > > > > I am trying to understanding

Re: get fn and not-found

2013-10-27 Thread Softaddicts
You are getting my-foo evaluated, remove the parens around it. Luc P. > Hello, > > I am trying to understanding why is this happening: > > > (defn my-foo [] (println "Why do I get printed?")) > > #'sandbox4724/my-foo > > > (get {:b 1} :b (my-foo)) > > Why do I get printed? > > 1 > > > > >

Re: get fn and not-found

2013-10-27 Thread dennis zhuang
The function's arguments will be evaluated before calling it. So the (my-foo) will be called before 'get'. 2013/10/28 Ryan > Hello, > > I am trying to understanding why is this happening: > > > (defn my-foo [] (println "Why do I get printed?")) >> #'sandbox4724/my-foo >> > (get {:b 1} :b (my-f

get fn and not-found

2013-10-27 Thread Ryan
Hello, I am trying to understanding why is this happening: > (defn my-foo [] (println "Why do I get printed?")) > #'sandbox4724/my-foo > > (get {:b 1} :b (my-foo)) > Why do I get printed? > 1 > > Shouldn't (my-foo) only be called in case the key isn't found? Why am I seeing the above behavio

Re: [ANN] Jig

2013-10-27 Thread Chris Zheng
Thanks Malcom, Even something really simple like showing your current project setup would be really good for me to get going. On 21/10/2013, at 15:57, Malcolm Sparks wrote: > Hi Chris, yes I will try to do something like that very soon. > > On Friday, October 18, 2013 12:30:20 AM UTC+1, zcaud