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 150 })
-->sorted the map by values and get the top-N user id

the main code of the former 2 steps is :

(let [ id-num {} ];;as your suggestion , here should use atom
   (with-open [rdr   (the file...)]
  (doseq  [line (line-seq rdr)]
 (let [params(split each line with "," )
id   (params 0)]
   (if  (id-num id)
(do  inc the value )
(do  add new  k-v )
)
...
I don't want to load the total file into memory, too big.
So referencing the suggestion from internet , i am using line-seq & doseq
to deal with the big log file lazily.
Is that right way to use clojue to deal this problem?

Any suggestions will be grateful!!!



2013/10/28 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 value assoc returns
> and/or clojure.core functions for manipulating collections,
> such as clojure.core/reduce.
>
> See http://clojure-doc.org/articles/language/core_overview.html,
> http://clojure-doc.org/articles/language/collections_and_sequences.html
> and
> http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
> --
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>
> --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 



刘家齐 (Jacky Liu)

**

手机:15201091195邮箱:liujiaq...@gmail.com

Skype:jacky_liu_1987   QQ:406229156

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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) 12(+ 5 (* 6 2)) 174 4(str (+ 3 4) (+ 5 (* 6 2)) 4)
"7174"

;; `print-sexp` replaces normal code like ->, ->>, let, cond, if, ;;
etc, where possible with print.foo versions
print.foo=> (pprint (macroexpand '(print-sexp (str (+ 3 4) (-> 5 (* 6)
(* 2)) 4(print.foo/print-and-return
 '(str (+ 3 4) (-> 5 (* 6) (* 2)) 4)
 " "
 (str
  (print.foo/print-and-return
   '(+ 3 4)
   " "
   (+
(print.foo/print-and-return '3 " " 3)
(print.foo/print-and-return '4 " " 4)))
  (print.foo/print-> 5 (* 6) (* 2))
  (print.foo/print-and-return '4 " " 4)))

As of now the latest version is 0.4.2.
https://github.com/AlexBaranosky/print-foo
https://clojars.org/print-foo

Best
Alex


On Thu, Mar 28, 2013 at 12:13 PM, Alex Baranosky <
alexander.barano...@gmail.com> wrote:

> Jim,
>
> No reason I left out loop/recur.  I just didn't get around to it.  Pull
> requests accepted.
>
>
> On Thu, Mar 28, 2013 at 12:07 PM, Alex Baranosky <
> alexander.barano...@gmail.com> wrote:
>
>> adrians,
>>
>> https://clojars.org/print-foo
>>
>> I've got to deploy it with proper signing.
>>
>>
>> On Thu, Mar 28, 2013 at 11:59 AM, adrians  wrote:
>>
>>> Alex, print-foo *is* the correct artifact name, no? It seemed to be
>>> pulled down fine by pomegranate.
>>>
>>>
>>> On Thursday, March 28, 2013 2:35:31 PM UTC-4, Alex Baranosky wrote:

 Let me fix the README, the library should be required like this
 (:require [print.foo :refer :all])

>>>  --
>>> --
>>> 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 from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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/

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 value assoc returns
and/or clojure.core functions for manipulating collections,
such as clojure.core/reduce.

See http://clojure-doc.org/articles/language/core_overview.html,
http://clojure-doc.org/articles/language/collections_and_sequences.html
and
http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 really don't get it.
Any suggestion??

BR!!




刘家齐 (Jacky Liu)

**

手机:15201091195邮箱:liujiaq...@gmail.com

Skype:jacky_liu_1987   QQ:406229156

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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:

> 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 and all sagacious wisdom greatly appreciated - thanks!
>>
>> - Scott
>>
>> --
>> --
>> 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 from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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.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 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 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 
>> 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 interesting as a DSL, but currently 
> usesVars 
> under the hood to manage connections and this doesn’t play well with 
> dynamic workflows as the 
> oneby 
> Stuart Sierra.
>
> Personally I’ve used just 
> clojure.java.jdbc(
> here  is a micro-tutorial that I’ve 
> written for it) that is going under an API overhaul to make connections 
> management more explicit and functional. If you need an SQL generation 
> library you could look at Honey SQL . 
>
> Hope it helps,
>
> Manuel 
>
> PS: You could also take a look at the new book Web Development in 
> Clojureby the 
> author of 
> Luminus .
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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


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 to templating) that is
> current and maintained?
>
> Any and all sagacious wisdom greatly appreciated - thanks!
>
> - Scott
>
> --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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:
* Significantly better source map support - should work with or without
Closure optimizations and should work with incremental compilation across
JVM runs. If you haven't tried the source map feature before, now's a good
time :)

Bug fixes:
CLJS-638: Keyword invoke is inconsistent with clojure
CLJS-632: use tools.reader's *alias-map* for tracking aliases instead of
Clojure namespaces
CLJS-471: prevent empty regexps from causing compiler errors
CLJS-628: *cljs-file* not bound when compiling to stdout
CLJS-634: do not call getPath on a null value
CLJS-635: Clojure consistent implementations of -rseq
CLJS-608: Stop re-seq after reaching end of string
CLJS-591: source relative path for source map
CLJS-617: double evaluation of ^not-native type-hinted expressions

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 interesting as a DSL, but currently 
usesVars under 
the hood to manage connections and this doesn’t play well with 
dynamic workflows as the 
oneby 
Stuart Sierra.

Personally I’ve used just 
clojure.java.jdbc(
here  is a micro-tutorial that I’ve 
written for it) that is going under an API overhaul to make connections 
management more explicit and functional. If you need an SQL generation 
library you could look at Honey SQL . 

Hope it helps,

Manuel 

PS: You could also take a look at the new book Web Development in 
Clojureby the 
author of 
Luminus .

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 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 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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 and all sagacious wisdom greatly appreciated - thanks!
>
> - Scott
>
> --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 to templating) that
> is current and maintained?
>
> Any and all sagacious wisdom greatly appreciated - thanks!
>
> - Scott
>
> --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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)) -- which does not, but treats a {:b nil}
entry as the same as absence of :b -- or

(let [sentinel (Object.)
  r (get a-map :b sentinel)]
  (if (identical? r sentinel)
(my-foo)
r)) -- which is longer and more complex, but calls my-foo (and returns
what it returns) if and only if :b is genuinely absent from the map (like
the first solution above) and performs the lookup only once (like the
second solution above). If this has to be done in a tight loop, the extra
efficiency over the second solution may be worth it, but you'll want to
avoid repeatedly creating and discarding the sentinel object as well,
resulting in something like

(def {^:private} sentinel (Object.))

...

(defn ...
...
  (loop ...
...
(let [r (get a-map :b sentinel)]
  (if (identical? r sentinel)
(my-foo)
r)) ... ) ... )



On Sun, Oct 27, 2013 at 1:00 PM, Ryan  wrote:

> 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 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 behavior instead?
>> >
>> > Thank you for your time,
>> >
>> > Ryan
>> >
>> > --
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Clojure" group.
>> > To post to this group, send email to clo...@googlegroups.com
>> > Note that posts from new members are moderated - please be patient with
>> your first post.
>> > To unsubscribe from this group, send email to
>> > clojure+u...@**googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/**group/clojure?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to clojure+u...@**googlegroups.com.
>> > For more options, visit 
>> > https://groups.google.com/**groups/opt_out.
>>
>> >
>> --
>> Softaddicts sent by ibisMail from my ipad!
>>
>  --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 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 behavior instead? 
> > 
> > Thank you for your time, 
> > 
> > Ryan 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> -- 
> Softaddicts> sent by ibisMail from 
> my ipad! 
>

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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
> > >  
> 
> 
> Shouldn't (my-foo) only be called in case the key isn't found? Why am I 
> seeing the above behavior instead?
> 
> Thank you for your time,
> 
> Ryan 
> 
> -- 
> -- 
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
--
Softaddicts sent by ibisMail from my ipad!

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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-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 behavior instead?
>
> Thank you for your time,
>
> Ryan
>
> --
> --
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
庄晓丹
Email:killme2...@gmail.com xzhu...@avos.com
Site:   http://fnil.net
Twitter:  @killme2008

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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 behavior instead?

Thank you for your time,

Ryan 

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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, zcaudate wrote:
>> 
>> Would it be possible to put up a video of a typical workflow example with 
>> pedestal. It's quite difficult for me to piece everything together just by 
>> reading the documentation.
>> Chris
>> 
> 
> -- 
> -- 
> 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 from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/E0BdR_AksiA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
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 from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.