Re: Best way to loop a map of maps

2013-12-10 Thread Jeroen van Dijk
Don't forget about the option of walking over a map by using
clojure.walk/postwalk or clojure.walk/prewalk

I use these functions often lately. Especially useful if you have to update
values in your map and they could occur anywhere. It is a bit tricky to get
working at first, because the return value of each step needs to match the
structure that is currently walked. For that reason you sometimes need to
switch between a postwalk instead of a prewalk etc.

Try this for a demo

(def m
  {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
   "outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)

(clojure.walk/postwalk-demo m)




On Thu, Dec 5, 2013 at 11:06 AM, Ryan  wrote:

> Thanks guys for the useful answers :)
>
> Ryan
>
>
> On Wednesday, December 4, 2013 1:27:57 AM UTC+2, James Ferguson wrote:
>>
>> `update-in` could be helpful, depending on what exactly you're doing.
>>
>> (doseq [keyA keys, keyB otherkeys]
>>   (update-in m [keyA keyB] some-function))
>>
>> On Tuesday, December 3, 2013 6:05:14 PM UTC-5, Ryan wrote:
>>>
>>> Hi all,
>>>
>>> I am trying to figure out a better way to loop the following map than
>>> using nested doseq. The map has the following structure:
>>>
>>> (def m
   {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
"outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)
>>>
>>>
>>> So, right now i am doing the following:
>>>
>>> (doseq [[outer-keys collections] m]
   (doseq [[collection-name collection] collections]
 (doseq [[string-id data] collection]
   ;; do stuff with all the above
 )))
>>>
>>>
>>> Is there a more idiomatic/better way to do deeply nested
>>> iterations/traversal of map of maps?
>>>
>>> Thank you for any replies!
>>>
>>> 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.
>

-- 
-- 
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: Best way to loop a map of maps

2013-12-10 Thread Ryan
I've seen postwalk and prewalk but never really played around with them so 
I will give it a shot.

Thanks for your input!

Ryan

On Tuesday, December 10, 2013 10:29:51 AM UTC+2, Jeroen van Dijk wrote:
>
> Don't forget about the option of walking over a map by using 
> clojure.walk/postwalk or clojure.walk/prewalk
>
> I use these functions often lately. Especially useful if you have to 
> update values in your map and they could occur anywhere. It is a bit tricky 
> to get working at first, because the return value of each step needs to 
> match the structure that is currently walked. For that reason you sometimes 
> need to switch between a postwalk instead of a prewalk etc.
>
> Try this for a demo
>
> (def m
>   {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
>"outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)
>
> (clojure.walk/postwalk-demo m)
>
>
>
>
> On Thu, Dec 5, 2013 at 11:06 AM, Ryan >wrote:
>
>> Thanks guys for the useful answers :)
>>
>> Ryan
>>
>>
>> On Wednesday, December 4, 2013 1:27:57 AM UTC+2, James Ferguson wrote:
>>>
>>> `update-in` could be helpful, depending on what exactly you're doing.
>>>
>>> (doseq [keyA keys, keyB otherkeys]
>>>   (update-in m [keyA keyB] some-function))
>>>
>>> On Tuesday, December 3, 2013 6:05:14 PM UTC-5, Ryan wrote:

 Hi all,

 I am trying to figure out a better way to loop the following map than 
 using nested doseq. The map has the following structure:

 (def m
>   {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
>"outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)


 So, right now i am doing the following:

 (doseq [[outer-keys collections] m]
>   (doseq [[collection-name collection] collections]
> (doseq [[string-id data] collection]
>   ;; do stuff with all the above 
> )))


 Is there a more idiomatic/better way to do deeply nested 
 iterations/traversal of map of maps?

 Thank you for any replies!

 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.
>>
>
>

-- 
-- 
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.


'neostore' does not contain a store version, please ensure that the original database was shut down in a clean state.

2013-12-10 Thread Himakshi Mangal
Hi,

I was using clojure to upload the dbpedia datasets into neo4j.

Unfortunately, my system hanged and i had to restart everything. Now, if i 
start the execution of program again it shows this error:

'neostore' does not contain a store version, please ensure that the 
original database was shut down in a clean state.


How can i solve this error so that i can start the uploading from the point 
it stopped?

Please help

-- 
-- 
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: Best way to loop a map of maps

2013-12-10 Thread Thomas Heller
FWIW you can simplify the nested doseqs like this

(doseq [[outer-keys collections] m
[collection-name collection] collections
[string-id data] collection]
  ;; do stuff with the above
  )

HTH,
/thomas


On Wednesday, December 4, 2013 12:05:14 AM UTC+1, Ryan wrote:
>
> Hi all,
>
> I am trying to figure out a better way to loop the following map than 
> using nested doseq. The map has the following structure:
>
> (def m
>>   {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
>>"outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)
>
>
> So, right now i am doing the following:
>
> (doseq [[outer-keys collections] m]
>>   (doseq [[collection-name collection] collections]
>> (doseq [[string-id data] collection]
>>   ;; do stuff with all the above 
>> )))
>
>
> Is there a more idiomatic/better way to do deeply nested 
> iterations/traversal of map of maps?
>
> Thank you for any replies!
>
> 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: Best way to loop a map of maps

2013-12-10 Thread Thomas Heller
Oh nvm, just saw that it was suggested before.

But maybe this is new:

(def m
  {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
   "outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)

(defn nested-seq [m]
  (for [[outer-key collections] m
[collection-name collection] collections
[string-id data] collection]
{:outer-key outer-key :collection-name collection-name :string-id 
string-id :data data}
))

(pprint (nested-seq m))

;; produces
({:outer "outerKeyA",
  :collection-name :innerKeyA,
  :string-id "string id",
  :data {:foo 1, :bar 2}}
 {:outer "outerKeyB",
  :collection-name :innerKeyB,
  :string-id "string id",
  :data {:bar 5, :baz 10}})



for list comprehensions behave like doseq except that they return whatever 
the body does, thus letting you move your side effects somewhere else.

Maybe this helps,
/thomas

On Tuesday, December 10, 2013 12:48:56 PM UTC+1, Thomas Heller wrote:
>
> FWIW you can simplify the nested doseqs like this
>
> (doseq [[outer-keys collections] m
> [collection-name collection] collections
> [string-id data] collection]
>   ;; do stuff with the above
>   )
>
> HTH,
> /thomas
>
>
> On Wednesday, December 4, 2013 12:05:14 AM UTC+1, Ryan wrote:
>>
>> Hi all,
>>
>> I am trying to figure out a better way to loop the following map than 
>> using nested doseq. The map has the following structure:
>>
>> (def m
>>>   {"outerKeyA" {:innerKeyA {"string id" {:foo 1 :bar 2}}}
>>>"outerKeyB" {:innerKeyB {"string id" {:bar 5 :baz 10)
>>
>>
>> So, right now i am doing the following:
>>
>> (doseq [[outer-keys collections] m]
>>>   (doseq [[collection-name collection] collections]
>>> (doseq [[string-id data] collection]
>>>   ;; do stuff with all the above 
>>> )))
>>
>>
>> Is there a more idiomatic/better way to do deeply nested 
>> iterations/traversal of map of maps?
>>
>> Thank you for any replies!
>>
>> 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.


clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Niels van Klaveren
Do I understand correctly that to prevent creating a collection per query I 
have to wrap multiple consecutive queries inside a `db-transaction` binding 
instead of the old `with-connection` bindings ?

-- 
-- 
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: clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Niels van Klaveren
Oops, should be 'connection' instead of 'collection', of course.

On Tuesday, December 10, 2013 5:24:23 PM UTC+1, Niels van Klaveren wrote:
>
> Do I understand correctly that to prevent creating a collection per query 
> I have to wrap multiple consecutive queries inside a `db-transaction` 
> binding instead of the old `with-connection` bindings ?
>

-- 
-- 
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.


My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
I am working on web software where admins will be using HTML forms to 
update data in a MongoDb database. I decided to use Lamina to off-load the 
work to the background. There are several operations that need to happen: 
updates, deletions, etc, and I thought I'd put each on a different channel. 
So I tried to write a macro to generate the code needed for each of those 
channels. This was my first attempt: 

(defmacro establish-channel [action noun to-execute start-function-name]
  (let [channel-name (symbol (str "documents-to-" action "-in-" noun 
"-channel"))
additive-action-name (symbol (str "add-to-" action "-channel"))
worker-name (symbol (str action "-" noun "-worker"))]

  `(def ~channel-name (channel))

  `(defn ~additive-action-name [document]
 (enqueue ~channel-name document))

  `(defn ~worker-name []
 (loop [document @(read-channel ~channel-name)]
   (~to-execute document)
   (recur @(read-channel ~channel-name
  
  `(defn ~start-function-name []
 (future (~worker-name))
 (future (~worker-name))
 (future (~worker-name))
 (future (~worker-name))
 (future (~worker-name)


But in the repl, when I run this, and then I do this:

user> (macroexpand-1 (establish-channel update mongo println 
start-mongo-channel))

I get: 

CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
update-mongo-worker in this context, compiling:(NO_SOURCE_PATH:1:16) 

It seems to be complaining about this line:

 (future (~worker-name))

But I defined that function just above that line: 

  `(defn ~worker-name []

So what could the problem be? 

-- 
-- 
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: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread James Reeves
Remember that only the last form will be returned. So:

(defn foo [] 1 2 3 4)

will always return 4. The same principle applied with your macro. You
define four forms, but only return the last one. Instead, try wrapping all
the forms in a "do" block.

As an aside, this doesn't look like a good use-case for macros. You'd
probably be better defining a map with keys for :worker, :channel, etc.
Either that or a protocol.

- James


On 10 December 2013 17:42, larry google groups wrote:

> I am working on web software where admins will be using HTML forms to
> update data in a MongoDb database. I decided to use Lamina to off-load
> the work to the background. There are several operations that need to
> happen: updates, deletions, etc, and I thought I'd put each on a different
> channel. So I tried to write a macro to generate the code needed for each
> of those channels. This was my first attempt:
>
> (defmacro establish-channel [action noun to-execute start-function-name]
>   (let [channel-name (symbol (str "documents-to-" action "-in-" noun
> "-channel"))
> additive-action-name (symbol (str "add-to-" action "-channel"))
> worker-name (symbol (str action "-" noun "-worker"))]
>
>   `(def ~channel-name (channel))
>
>   `(defn ~additive-action-name [document]
>  (enqueue ~channel-name document))
>
>   `(defn ~worker-name []
>  (loop [document @(read-channel ~channel-name)]
>(~to-execute document)
>(recur @(read-channel ~channel-name
>
>   `(defn ~start-function-name []
>  (future (~worker-name))
>  (future (~worker-name))
>  (future (~worker-name))
>  (future (~worker-name))
>  (future (~worker-name)
>
>
> But in the repl, when I run this, and then I do this:
>
> user> (macroexpand-1 (establish-channel update mongo println
> start-mongo-channel))
>
> I get:
>
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> update-mongo-worker in this context, compiling:(NO_SOURCE_PATH:1:16)
>
> It seems to be complaining about this line:
>
>  (future (~worker-name))
>
> But I defined that function just above that line:
>
>   `(defn ~worker-name []
>
> So what could the problem be?
>
>  --
> --
> 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: Big Excel (xlsx) file parsing (docjure, incanter...)

2013-12-10 Thread scott tudd
orthogonal, perhaps helpful:

I wrote a clojure (wrapper) library that "streams" data in-and-out of Excel 
quite easily (and other applications, mostly finance, that use DDE).
especially useful if you need to monitor or updates changes to cells.

https://github.com/tuddman/clj-dde

feedback welcome.

On Saturday, September 7, 2013 10:28:57 AM UTC-4, Stanislav Sobolev wrote:
>
> Allright, but if use SXSSF how can i stream excel file to that? 
> https://github.com/ktsujister/clj-tsv2xls/blob/master/src/tsv2xls/core.clj 
> Like 
> in this example
> can anybody provide me code example of using that streaming please?
> with-open [out-stream (io/output-stream outfile) and further?
>
>
> суббота, 7 сентября 2013 г., 12:30:43 UTC+6 пользователь Vijay Kiran 
> написал:
>>
>> Hi,
>>
>> I don't think docjure supports streaming options yet  - but you can try 
>> using Apache POI streaming API - 
>> http://poi.apache.org/spreadsheet/index.html - that should help in 
>> reading large files.
>>
>> HTH,
>> @vijaykiran
>>  
>>
>> On Saturday, September 7, 2013 3:22:27 AM UTC+2, Stanislav Sobolev wrote:
>>>
>>> Hello guys. I have excel file with huge columns in there.
>>> When i used some plugin(docjure, or anything else) it shows 
>>> me CompilerException java.lang.OutOfMemoryError: Java heap space, compiling
>>> How can i handle that big file without converting it to csv? 
>>> Primary problem in xlsx structure, it doesnt have lines or something, 
>>> unlike csv.
>>>
>>

-- 
-- 
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: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups

> As an aside, this doesn't look like a good use-case for macros
>. You'd probably be better defining a map with keys for :
> worker, :channel, etc. Either that or a protocol.
 
Thank you much for your help. But I thought this is exactly what macros 
were for? In another language I would end up just copying-and-pasting the 4 
defs, and then changing "update" to "remove" so I could have both an update 
channel and a remove channel. I thought that macros were suppose to be good 
at removing that kind of redundancy? 




On Tuesday, December 10, 2013 12:53:31 PM UTC-5, James Reeves wrote:
>
> Remember that only the last form will be returned. So:
>
> (defn foo [] 1 2 3 4)
>
> will always return 4. The same principle applied with your macro. You 
> define four forms, but only return the last one. Instead, try wrapping all 
> the forms in a "do" block.
>
> As an aside, this doesn't look like a good use-case for macros. You'd 
> probably be better defining a map with keys for :worker, :channel, etc. 
> Either that or a protocol.
>
> - James
>
>
> On 10 December 2013 17:42, larry google groups 
> 
> > wrote:
>
>> I am working on web software where admins will be using HTML forms to 
>> update data in a MongoDb database. I decided to use Lamina to off-load 
>> the work to the background. There are several operations that need to 
>> happen: updates, deletions, etc, and I thought I'd put each on a different 
>> channel. So I tried to write a macro to generate the code needed for each 
>> of those channels. This was my first attempt: 
>>
>> (defmacro establish-channel [action noun to-execute start-function-name]
>>   (let [channel-name (symbol (str "documents-to-" action "-in-" noun 
>> "-channel"))
>> additive-action-name (symbol (str "add-to-" action "-channel"))
>> worker-name (symbol (str action "-" noun "-worker"))]
>>
>>   `(def ~channel-name (channel))
>>
>>   `(defn ~additive-action-name [document]
>>  (enqueue ~channel-name document))
>>
>>   `(defn ~worker-name []
>>  (loop [document @(read-channel ~channel-name)]
>>(~to-execute document)
>>(recur @(read-channel ~channel-name
>>   
>>   `(defn ~start-function-name []
>>  (future (~worker-name))
>>  (future (~worker-name))
>>  (future (~worker-name))
>>  (future (~worker-name))
>>  (future (~worker-name)
>>
>>
>> But in the repl, when I run this, and then I do this:
>>
>> user> (macroexpand-1 (establish-channel update mongo println 
>> start-mongo-channel))
>>
>> I get: 
>>
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol: 
>> update-mongo-worker in this context, compiling:(NO_SOURCE_PATH:1:16) 
>>
>> It seems to be complaining about this line:
>>
>>  (future (~worker-name))
>>
>> But I defined that function just above that line: 
>>
>>   `(defn ~worker-name []
>>
>> So what could the problem be? 
>>
>>  -- 
>> -- 
>> 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.
>>
>
>

-- 
-- 
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: 'neostore' does not contain a store version, please ensure that the original database was shut down in a clean state.

2013-12-10 Thread Joseph Guhlin
When is this happening, during the batch import or after for a query?

It sounds like an incomplete shutdown. You need to make sure you issue a 
.shutdown to the db (batchinserter) and give it time to complete, it can 
take awhile.

Make sure you have write permissions for the directory. And always start 
with a clean directory (delete any previous datastores) for a Batch Insert.

If you are running it under lein you need to use ^:replace for :jvm-opts or 
it will slow things down considerably.
Here is what I am using in my project.clj, they are based off of what Neo4j 
uses from the command line and some benchmarks. You may want to reduce the 
-Xms and -Xmx. What are you giving Neo4j for memory as well when you start 
it up? It uses it's own memory allocation and can exceed what you give the 
JVM, so you want to give Neo4j more and clojure less, and want both to be 
less than your total ram so you do not hit swap space (which will slow it 
down again too).

  :jvm-opts ^:replace [
 "-Xms6G"
 "-Xmx8G"
 "-XX:+UseConcMarkSweepGC"
 "-XX:+UseBiasedLocking"
 "-XX:+AggressiveOpts"
 "-XX:+UseFastAccessorMethods"
 "-XX:+UseCondCardMark"
 ]

--Joseph

On Tuesday, December 10, 2013 4:00:09 AM UTC-6, Himakshi Mangal wrote:
>
> Hi,
>
> I was using clojure to upload the dbpedia datasets into neo4j.
>
> Unfortunately, my system hanged and i had to restart everything. Now, if i 
> start the execution of program again it shows this error:
>
> 'neostore' does not contain a store version, please ensure that the 
> original database was shut down in a clean state.
>
>
> How can i solve this error so that i can start the uploading from the 
> point it stopped?
>
> Please help
>

-- 
-- 
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: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread James Reeves
On 10 December 2013 18:24, larry google groups wrote:

>
> > As an aside, this doesn't look like a good use-case for macros
> >. You'd probably be better defining a map with keys for :
> > worker, :channel, etc. Either that or a protocol.
>
> Thank you much for your help. But I thought this is exactly what macros
> were for? In another language I would end up just copying-and-pasting the 4
> defs, and then changing "update" to "remove" so I could have both an update
> channel and a remove channel. I thought that macros were suppose to be good
> at removing that kind of redundancy?
>

Macros should be considered a "last resort" feature. They are usually the
worst way of solving a problem, unless they are the *only* way of solving a
problem.

Let's consider the functions your macros produce (ignoring the channel for
now):


(add-to-update-channel document)

(update-mongo-worker)

(start-mongo-channel)


These functions are very specific, but we can make them more
general-purpose by adding an additional argument:

(add-to-channel mongo-updates document)

(update-worker mongo-updates)

(start-channel mongo-updates)


Since these are generic functions, any specific functionality must be
defined by the new "mongo-updates" argument. In your example there are two
things specific to the mongo update job: the channel, and the function to
execute.

We could place these two piece of information in a data structure:

(def mongo-updates

  {:channel (channel)

   :to-execute println})


Or we could define a type or protocol. For now the map seems good enough,
and we can use it to build generic versions of the functions generated by
your macro:

(defn add-to-channel [{:keys [channel]} data]
  (enqueue channel document))

(defn update-worker [{:keys [channel to-execute]}]
  (loop [document @(read-channel channel)]
(to-execute document)
(recur @(read-channel channel

(defn start-channel [worker-info]

  (dotimes [_ 6]

(future (update-worker worker-info


- James

-- 
-- 
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: 'neostore' does not contain a store version, please ensure that the original database was shut down in a clean state.

2013-12-10 Thread Wes Freeman
Try starting it up with the neo4j-shell to see if it will go through its
recovery. Like so:
bin/neo4j-shell -path 

And then exiting properly with "exit".

You didn't say how you were importing, but if this happened during an
org.neo4j.unsafe.BatchInserter run, you might be out of luck--the point of
the unsafe package is that it doesn't do journaling, and can't recover from
fatal errors like that. You'd need to start over from the beginning.

Wes

On Tue, Dec 10, 2013 at 1:33 PM, Joseph Guhlin wrote:

> When is this happening, during the batch import or after for a query?
>
> It sounds like an incomplete shutdown. You need to make sure you issue a
> .shutdown to the db (batchinserter) and give it time to complete, it can
> take awhile.
>
> Make sure you have write permissions for the directory. And always start
> with a clean directory (delete any previous datastores) for a Batch Insert.
>
> If you are running it under lein you need to use ^:replace for :jvm-opts
> or it will slow things down considerably.
> Here is what I am using in my project.clj, they are based off of what
> Neo4j uses from the command line and some benchmarks. You may want to
> reduce the -Xms and -Xmx. What are you giving Neo4j for memory as well when
> you start it up? It uses it's own memory allocation and can exceed what you
> give the JVM, so you want to give Neo4j more and clojure less, and want
> both to be less than your total ram so you do not hit swap space (which
> will slow it down again too).
>
>   :jvm-opts ^:replace [
>  "-Xms6G"
>  "-Xmx8G"
>  "-XX:+UseConcMarkSweepGC"
>  "-XX:+UseBiasedLocking"
>  "-XX:+AggressiveOpts"
>  "-XX:+UseFastAccessorMethods"
>  "-XX:+UseCondCardMark"
>  ]
>
> --Joseph
>
> On Tuesday, December 10, 2013 4:00:09 AM UTC-6, Himakshi Mangal wrote:
>>
>> Hi,
>>
>> I was using clojure to upload the dbpedia datasets into neo4j.
>>
>> Unfortunately, my system hanged and i had to restart everything. Now, if
>> i start the execution of program again it shows this error:
>>
>> 'neostore' does not contain a store version, please ensure that the
>> original database was shut down in a clean state.
>>
>>
>> How can i solve this error so that i can start the uploading from the
>> point it stopped?
>>
>> Please help
>>
>  --
> --
> 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.


odd failure on recursive use of protocol member

2013-12-10 Thread Michael Blume
I have a protocol RestSerializable to represent data that can be serialized 
to json from a REST interface.

(defprotocol RestSerializable
  (rest-serialize [this]
   "Convert to something Cheshire can JSONify"))

By default, things are left alone

(extend Object
  RestSerializable
  {:rest-serialize identity})

But I want atoms and the like to be transparent when serialized

(extend clojure.lang.IDeref
  RestSerializable
  {:rest-serialize (comp rest-serialize deref)})

I would expect this to mean that, say, 

(-> 42 atom atom atom atom rest-serialize)

would just unwrap to 42, but in fact it only unwraps the outer atom and 
leaves the inner ones alone.

Here's where it gets weird though. If I just evaluate the extend 
clojure.lang.IDeref form again, rest-serialize suddenly gains the ability 
to unwrap *two* layers of atoms. Eval it again and it can unwrap *three*. 
Kinda feels like the exercises in Little Schemer when they're building up 
to the Y Combinator.

Here's my REPL session demonstrating this (not shown, but I've verified 
this behavior is the same in Clojure 1.5.1 and Clojure 1.6.0-alpha3)

$ lein repl
nREPL server started on port 46049 on host 127.0.0.1
REPL-y 0.2.1
Clojure 1.5.1
Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (defprotocol RestSerializable
  #_=>   (rest-serialize [this]
  #_=>"Convert to something Cheshire can JSONify"))
RestSerializable
user=> 

user=> (extend Object
  #_=>   RestSerializable
  #_=>   {:rest-serialize identity})
nil
user=> 

user=> (extend clojure.lang.IDeref
  #_=>   RestSerializable
  #_=>   {:rest-serialize (comp rest-serialize deref)})
nil
user=> (-> 7 atom atom atom rest-serialize)
#>
user=> (-> 7 atom atom atom rest-serialize)
#>
user=> (-> 7 atom atom atom rest-serialize)
#>
user=> (extend clojure.lang.IDeref
  #_=>   RestSerializable
  #_=>   {:rest-serialize (comp rest-serialize deref)})
nil
user=> (-> 7 atom atom atom rest-serialize)
#
user=> (-> 7 atom atom atom rest-serialize)
#
user=> (extend clojure.lang.IDeref
  #_=>   RestSerializable
  #_=>   {:rest-serialize (comp rest-serialize deref)})
nil
user=> (-> 7 atom atom atom rest-serialize)
7
user=> (quit)
Bye for now!

-- 
-- 
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: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups

Thanks much. Your approach is much better than mine. I was looking for a 
good excuse to use a macro, but I suppose I will postpone that for another 
day.


On Tuesday, December 10, 2013 2:03:07 PM UTC-5, James Reeves wrote:
>
> On 10 December 2013 18:24, larry google groups 
> 
> > wrote:
>
>>
>> > As an aside, this doesn't look like a good use-case for macros
>> >. You'd probably be better defining a map with keys for :
>> > worker, :channel, etc. Either that or a protocol.
>>  
>> Thank you much for your help. But I thought this is exactly what macros 
>> were for? In another language I would end up just copying-and-pasting the 4 
>> defs, and then changing "update" to "remove" so I could have both an update 
>> channel and a remove channel. I thought that macros were suppose to be good 
>> at removing that kind of redundancy? 
>>
>
> Macros should be considered a "last resort" feature. They are usually the 
> worst way of solving a problem, unless they are the *only* way of solving 
> a problem.
>
> Let's consider the functions your macros produce (ignoring the channel for 
> now):
>
>
> (add-to-update-channel document)
>
> (update-mongo-worker)
>
> (start-mongo-channel)
>
>
> These functions are very specific, but we can make them more 
> general-purpose by adding an additional argument:
>
> (add-to-channel mongo-updates document)
>
> (update-worker mongo-updates)
>
> (start-channel mongo-updates)
>
>
> Since these are generic functions, any specific functionality must be 
> defined by the new "mongo-updates" argument. In your example there are two 
> things specific to the mongo update job: the channel, and the function to 
> execute.
>
> We could place these two piece of information in a data structure:
>
> (def mongo-updates
>
>   {:channel (channel)
>
>:to-execute println})
>
>
> Or we could define a type or protocol. For now the map seems good enough, 
> and we can use it to build generic versions of the functions generated by 
> your macro:
>
> (defn add-to-channel [{:keys [channel]} data]
>   (enqueue channel document))
>
> (defn update-worker [{:keys [channel to-execute]}]
>   (loop [document @(read-channel channel)]
> (to-execute document)
> (recur @(read-channel channel
>   
> (defn start-channel [worker-info]
>
>   (dotimes [_ 6]
>
> (future (update-worker worker-info
>
>
> - James
>

-- 
-- 
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] clojure.tools.cli 0.3.0-beta1

2013-12-10 Thread guns
Hello everyone,

I am happy to announce the beta release of the next version of
clojure.tools.cli:

https://github.com/clojure/tools.cli#new-features

Leiningen dependency information:

[org.clojure/tools.cli "0.3.0-beta1"]

Maven dependency information:


  org.clojure
  tools.cli
  0.3.0-beta1


The project README linked above has the details, but here is a summary:

  * There is a new function, clojure.tools.cli/parse-opts, that supports

- GNU option conventions (`-abc` -> `-a -b -c`, `--long-opt=ARG`)
- In-order argument processing (for separate subcommand options)
- Option argument validations
- Custom option summaries
- Error handling without throwing exceptions

  * tools.cli now ships with a ClojureScript namespace:

  cljs.tools.cli

parse-opts has been ported to CLJS with feature parity.

  * The previous function, clojure.tools.cli/cli, has been adapted to
use the new option tokenizer, but otherwise remains unchanged.
Upgrading is therefore encouraged even if you do not plan on
migrating to parse-opts.

Though it has been superseded, cli/cli will not be removed in the
forseeable future.

My goal with this new version is to convince application and library
authors to choose tools.cli/parse-opts over hand-rolled parsers!

In pursuit of this, I welcome feedback from the community so we can make
amendments before a final release.

Finally, I would like to express sincere thanks to Gareth Jones for
giving me the opportunity to contribute to the tools.cli project.

Cheers,
Sung Pae


pgpXoqWmJQKEz.pgp
Description: PGP signature


"Dynamically" push / pull / read Data Into and Out of Excel

2013-12-10 Thread scott tudd
built a clojure (wrapper) library:

https://github.com/tuddman/clj-dde

basically it can 'monitor' defined Excel cells for changes... which can 
'trigger' your clojure app to do stuff.
conversely, can add / modify data in Excel cells programmaticaly from 
clojure ;-), as well.

useful for 'real-time' applications. mostly finance or monitoring related. 
or anything else that utilizes Excel.  Or a 'DDE enabled' application.

feedback welcome.

-- 
-- 
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: clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Sean Corfield
No, you don't have to use db-transaction (although that will have that effect).

You can get a connection and assoc it into the db-spec with a
:connection key and pass that across multiple queries etc, and it will
reuse the :connection passed in:

(with-open [con (get-connection db-spec)]
  (let [connected (add-connection db-spec con)]
... several queries etc using connected instead of db-spec ...
  ))

Sean


On Tue, Dec 10, 2013 at 8:24 AM, Niels van Klaveren
 wrote:
> Do I understand correctly that to prevent creating a collection per query I
> have to wrap multiple consecutive queries inside a `db-transaction` binding
> instead of the old `with-connection` bindings ?
>
> --
> --
> 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.


Re: [ClojureCLR] clr.tools.nrepl

2013-12-10 Thread dmiller
Not functional yet.  About 50-60% completed.
I ran into some bugs -- it turns out that sockets in JVM and CLR are not 
exactly identical, no great surprise -- and got distracted by versions 1.5 
and 1.6alpha and support for mono and nuget for ClojureCLR.
I plan to finish the core.async port (it's at 90%) and then get back to 
this.
Unless someone beats me to it.

-David
 

On Monday, December 9, 2013 7:09:23 PM UTC-6, Frank Hale wrote:
>
> I'm attempting to run the CLR version of nREPL. I've cloned the code from:
>
> https://github.com/clojure/clr.tools.nrepl
>
> However, I'm not sure how to run the REPL. Doing lein run results in the 
> following message:
>
> "No :main namespace specified in project.clj."
>
> running lein compile doesn't fail but doesn't appear to do anything.
>
> running lein uberjar works but I can't run the resulting jar's because 
> they don't have a main manifest attribute.
>
> running lein test results in the following message:
>
> "Error: Could not find or load main class clojure.main
> Tests failed."
>
> There is little to no information on the usage or status of this package. 
> Is this working yet?
>

-- 
-- 
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.


type hinting overloaded methods

2013-12-10 Thread Phillip Lord


I want to type hint an overloaded Java method. I used to have a function
like so

(defn iri [name]
 (IRI/create name))

Where IRI.create is one of 

IRI.create(String)
IRI.create(URL)
IRI.create(File)

Type hinting the return value of this is straight-forward, but the
parameter is one of three types. The only way I seem to be able to get
this to work is to do lots of instance? checks...


(defn ^IRI iri
  [name]
  (cond
   (instance? String name)
   (IRI/create ^String name)
   (instance? java.net.URL name)
   (IRI/create ^java.net.URL name)
   (instance? java.io.File name)
   (IRI/create ^java.io.File name)))

which is a lot longer and, well, just not very nice. I could make this
neater with a macro -- something like...

(with-types [String, URL, File]
   (IRI/create name))

which would expand into the cond form above. But the instance? checks
seem not ideal. Is there a better solution?

Phil

-- 
-- 
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: error-on-reflection

2013-12-10 Thread Phillip Lord

Perfect -- I can use lein check interactively, and this in my unit
tests. It's a shame *warn-on-reflection* doesn't take a function, which
would be the general solution.

Phil

Tassilo Horn  writes:
> phillip.l...@newcastle.ac.uk (Phillip Lord) writes:
>
>> I know about *warn-on-reflection* but is there anyway that I can get
>> an error-on-reflection instead?
>
> I don't think so.
>
>> I've been type hinting my application (50% done and yes it goes faster
>> now), and it's a bit painful. What I would really want is to have a
>> unit test which fails if reflection is used.
>>
>> So far, my best idea is catching standard-out and parsing it for
>> reflection warnings. Not ideal.
>
> clojure/test/clojure/test_helper.clj already contains some helper macros
> for doing that, e.g., `should-not-reflect`:
>
> https://github.com/clojure/clojure/blob/0b73494c3c855e54b1da591eeb687f24f608f346/test/clojure/test_helper.clj#L126
>
> One problem is, though, that you not only get reflection warnings for
> your own code but also for code in dependencies.  So you need to tweak
> that macro with another regex that matches only reflection warnings in
> your own files.  But then you should be able to do something like this:
>
>
> (ns myproject.test
>   :require [clojure.test :as test])
>
> (defmacro should-not-reflect ...)
>   
> (test/deftest no-reflection-at-all
>   (should-not-reflect
> (do
>   (require 'myproject.ns1 :reload)
>   (require 'myproject.ns2 :reload)
>   ...)))
>
>
> HTH,
> Tassilo
>
>

-- 
Phillip Lord,   Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics, Email: phillip.l...@newcastle.ac.uk
School of Computing Science,
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,   skype: russet_apples
Newcastle University,   twitter: phillord
NE1 7RU 

-- 
-- 
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: error-on-reflection

2013-12-10 Thread Phillip Lord

I wasn't and this is actually very useful. Thanks for the pointer.

"John D. Hume"  writes:

> Are you aware of `lein check`? We have our some of our CI builds wired to
> fail if that finds anything.
> On Dec 9, 2013 4:12 AM, "Phillip Lord"  wrote:
>
>>
>> I know about *warn-on-reflection* but is there anyway that I can get an
>> error-on-reflection instead?
>>
>> I've been type hinting my application (50% done and yes it goes faster
>> now), and it's a bit painful. What I would really want is to have a unit
>> test which fails if reflection is used.
>>
>> So far, my best idea is catching standard-out and parsing it for
>> reflection warnings. Not ideal.
>>
>> Phil
>>
>> --
>> --
>> 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.
>>
>
> -- 

-- 
Phillip Lord,   Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics, Email: phillip.l...@newcastle.ac.uk
School of Computing Science,
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,   skype: russet_apples
Newcastle University,   twitter: phillord
NE1 7RU 

-- 
-- 
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: [ClojureCLR] clr.tools.nrepl

2013-12-10 Thread Frank Hale
Okay no problem.


On Tue, Dec 10, 2013 at 4:32 PM, dmiller  wrote:

> Not functional yet.  About 50-60% completed.
> I ran into some bugs -- it turns out that sockets in JVM and CLR are not
> exactly identical, no great surprise -- and got distracted by versions 1.5
> and 1.6alpha and support for mono and nuget for ClojureCLR.
> I plan to finish the core.async port (it's at 90%) and then get back to
> this.
> Unless someone beats me to it.
>
> -David
>
>
> On Monday, December 9, 2013 7:09:23 PM UTC-6, Frank Hale wrote:
>>
>> I'm attempting to run the CLR version of nREPL. I've cloned the code from:
>>
>> https://github.com/clojure/clr.tools.nrepl
>>
>> However, I'm not sure how to run the REPL. Doing lein run results in the
>> following message:
>>
>> "No :main namespace specified in project.clj."
>>
>> running lein compile doesn't fail but doesn't appear to do anything.
>>
>> running lein uberjar works but I can't run the resulting jar's because
>> they don't have a main manifest attribute.
>>
>> running lein test results in the following message:
>>
>> "Error: Could not find or load main class clojure.main
>> Tests failed."
>>
>> There is little to no information on the usage or status of this package.
>> Is this working yet?
>>
>  --
> --
> 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: clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Andrey Antukh
Hi!

In my opinion, this has a lot of boilerplate for basic operation like this
(reuse a connection for few operations).

The deprecated api of clojure.java.jdbc had some useful methods for do it
more concise and intuitive, you can use it.
Also, you can try use a connection pool for avoid this boilerplate or find
a more concise alternative to clojure.java.jdbc library.

My two cents.

Andrey


2013/12/10 Sean Corfield 

> No, you don't have to use db-transaction (although that will have that
> effect).
>
> You can get a connection and assoc it into the db-spec with a
> :connection key and pass that across multiple queries etc, and it will
> reuse the :connection passed in:
>
> (with-open [con (get-connection db-spec)]
>   (let [connected (add-connection db-spec con)]
> ... several queries etc using connected instead of db-spec ...
>   ))
>
> Sean
>
>
> On Tue, Dec 10, 2013 at 8:24 AM, Niels van Klaveren
>  wrote:
> > Do I understand correctly that to prevent creating a collection per
> query I
> > have to wrap multiple consecutive queries inside a `db-transaction`
> binding
> > instead of the old `with-connection` bindings ?
> >
> > --
> > --
> > 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.
>



-- 
Andrey Antukh - Андрей Антух - 
http://www.niwi.be/about.html
http://www.kaleidos.net/A5694F/

"Linux is for people who hate Windows, BSD is for people who love UNIX"
"Social Engineer -> Because there is no patch for human stupidity"

-- 
-- 
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: type hinting overloaded methods

2013-12-10 Thread John D. Hume
On Tue, Dec 10, 2013 at 4:25 AM, Phillip Lord
wrote:

> (defn ^IRI iri
>   [name]
>   (cond
>(instance? String name)
>(IRI/create ^String name)
>(instance? java.net.URL name)
>(IRI/create ^java.net.URL name)
>(instance? java.io.File name)
>(IRI/create ^java.io.File name)))
>
> which is a lot longer and, well, just not very nice. I could make this
> neater with a macro -- something like...
>
> (with-types [String, URL, File]
>(IRI/create name))
>
> which would expand into the cond form above. But the instance? checks
> seem not ideal. Is there a better solution?
>

You could create and extend an "IIriCreate" protocol to String, URL, and
File.

I'd like to point out that Java doesn't provide a clean way to handle this
either.

-- 
-- 
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: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread Cedric Greevey
On Tue, Dec 10, 2013 at 12:53 PM, James Reeves wrote:

> Remember that only the last form will be returned. So:
>
> (defn foo [] 1 2 3 4)
>
>   `(defn ~start-function-name []
> will always return 4. The same principle applied with your macro. You
> define four forms, but only return the last one. Instead, try wrapping all
> the forms in a "do" block.
>

Let contains an implicit (do ...) ...

... but it looks like what's needed is an explicit `(do ...)

-- 
-- 
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.


loop/recur with multiple branches

2013-12-10 Thread Glen Mailer
I was recently working on some toy recursion problems, when I ran into a 
function that I can express simply using normaly recursion, but I can't 
seem to convert it into a form that works nicely with loop/recur.

It's certainly not the right way to solve this problem, but I'm intrigued 
to see what this pattern looks like with explicit tail calls:

Problem:
Extract a slice from a list
(slice [ 3 4 5 6 7 8 9 ] 2 4)
;=> [ 5 6 7 8 ]

Normal Recursive Solution:
(defn slice [[h & tail] s n]
  (cond
(zero? n) nil
(zero? s) (cons h (slice tail s (dec n)))
:else (slice tail (dec s) n)))

What would the tail recursive version of this look like? can it retain the 
nice readability of this form?


-- 
-- 
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: Recruiter claims to be Rich Hickey's sister

2013-12-10 Thread Alexandre Karpov
Just got contected by the same recruiter...

On Monday, December 2, 2013 2:44:36 PM UTC-8, nodename wrote:
>
> Can I get a quick reality check on this?
> Thanks!
>
> -A
>
>

-- 
-- 
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: loop/recur with multiple branches

2013-12-10 Thread Cedric Greevey
On Tue, Dec 10, 2013 at 6:09 PM, Glen Mailer  wrote:

> I was recently working on some toy recursion problems, when I ran into a
> function that I can express simply using normaly recursion, but I can't
> seem to convert it into a form that works nicely with loop/recur.
>
> It's certainly not the right way to solve this problem, but I'm intrigued
> to see what this pattern looks like with explicit tail calls:
>
> Problem:
> Extract a slice from a list
> (slice [ 3 4 5 6 7 8 9 ] 2 4)
> ;=> [ 5 6 7 8 ]
>
> Normal Recursive Solution:
> (defn slice [[h & tail] s n]
>   (cond
> (zero? n) nil
> (zero? s) (cons h (slice tail s (dec n)))
> :else (slice tail (dec s) n)))
>
> What would the tail recursive version of this look like? can it retain the
> nice readability of this form?
>

What about the accumulator pattern?

(defn slice
  ([h s n]
(slice h s n nil))
  ([[h & tail] s n acc]
(cond
  (zero? n) acc
  (zero? s) (recur tail s (dec n) (cons h acc))
  :else (recur tail (dec s) n acc

-- 
-- 
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: loop/recur with multiple branches

2013-12-10 Thread Vincent Chen
On Tue, Dec 10, 2013 at 11:09 PM, Glen Mailer  wrote:
> I was recently working on some toy recursion problems, when I ran into a
> function that I can express simply using normaly recursion, but I can't seem
> to convert it into a form that works nicely with loop/recur.
>
> It's certainly not the right way to solve this problem, but I'm intrigued to
> see what this pattern looks like with explicit tail calls:
>
> Problem:
> Extract a slice from a list
> (slice [ 3 4 5 6 7 8 9 ] 2 4)
> ;=> [ 5 6 7 8 ]
>
> Normal Recursive Solution:
> (defn slice [[h & tail] s n]
>   (cond
> (zero? n) nil
> (zero? s) (cons h (slice tail s (dec n)))
> :else (slice tail (dec s) n)))
>
> What would the tail recursive version of this look like? can it retain the
> nice readability of this form?
>
Try this (not tested, might be missing parens and whatnot):

(defn slice [x s n]
  (loop [[h & tail] x, s s, n n, acc []]
(cond
  (zero? n) acc
  (zero? s) (recur tail s (dec n) (conj acc h))
  :else (recur tail (dec s) n acc

Few notes:
- When trying for tail recursions, use an accumulator. The accumulator
carries the eventual result, which is returned at the base case.
- Since we're destructuring into head and tail, I used vectors. conj
will push to the end of the vector.
- In Clojure, vectors tend to be more natural than lists. Accumulating
into lists usually requires a reverse in the base case.

Regards,

Vincent Chen

-- 
-- 
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: loop/recur with multiple branches

2013-12-10 Thread Cedric Greevey
On Tue, Dec 10, 2013 at 6:29 PM, Vincent Chen  wrote:

> Try this (not tested, might be missing parens and whatnot):
>
> (defn slice [x s n]
>   (loop [[h & tail] x, s s, n n, acc []]
> (cond
>   (zero? n) acc
>   (zero? s) (recur tail s (dec n) (conj acc h))
>   :else (recur tail (dec s) n acc
>
> Few notes:
> - When trying for tail recursions, use an accumulator. The accumulator
> carries the eventual result, which is returned at the base case.
> - Since we're destructuring into head and tail, I used vectors. conj
> will push to the end of the vector.
> - In Clojure, vectors tend to be more natural than lists. Accumulating
> into lists usually requires a reverse in the base case.


If you're going to go with vectors, why not go transient as well?

(defn slice [x s n]
  (loop [[h & tail] x, s s, n n, acc (transient [])]
(cond
  (zero? n) (persistent! acc)
  (zero? s) (recur tail s (dec n) (conj! acc h))
  :else (recur tail (dec s) n acc

Might be more runtime efficient.

-- 
-- 
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] Buffy The ByteBuffer Slayer, Clojure library to working with binary data

2013-12-10 Thread Oleksandr Petrov
@Cesar

I've made a little advancement on dynamic encoding/decoding, here's a gist
with a proof of concept: https://gist.github.com/ifesdjeen/7902409


On Wed, Dec 4, 2013 at 8:28 AM, Cesar Canassa wrote:

> Hi,
>
> I see that the repeated-type requires a constant repeat count. Are you
> planning to include a more dynamic version à la Gloss prefixes/headers?
>
> The lib looks really nice. Binary handling libraries are really helpful.
>
> Thanks,
> Cesar Canassa
>
>
>
> On Mon, Dec 2, 2013 at 7:09 PM, Alex P  wrote:
>
>> It's different in a way we manipulate the data:
>>
>> We've opted out for default-lazy way (you're getting and setting separate
>> values instead of serialising/deserialising an entire payload).
>>
>> Another difference is that we don't have Lamina as a loaded artifact
>> (which may not be an issue for majority of people, but was for us
>> because of an internal version conflict with some other library).
>> Obviously, there are ways around it, but we tried to bring in minimum
>> possible amount of dependencies, and be able to use it with Netty4 (which
>> is currently underrepresented in Clojure world).
>>
>> There are other subtle difference, but I don't think they're worth
>> mentioning, Gloss is a great library, but Buffy is doing things in a subtly
>> different way. Main purpose (as we're using it) - for off-heap storage /
>> data structures, and for binary protocol implementations in Clojure
>> (right now, we have a sketch of Cassandra binary protocol implemented on
>> top of Buffy, although I'm not sure wether it's going to be
>> production-ready any time soon).
>>
>>
>> Thanks for props!
>>
>> On Saturday, November 30, 2013 10:33:31 PM UTC+1, Thomas wrote:
>>>
>>> Looks really really great and could you please explain how it differs
>>> from gloss [1]. Any advantages? Disadvantages?
>>>
>>> Thanks
>>> Thomas
>>>
>>> [1] 
>>> https://github.com/ztellman/gloss
>>>
>>> On Friday, November 29, 2013 10:15:45 PM UTC, Alex P wrote:

 Buffy [1] is a Clojure library to work with Binary Data, write complete
 binary protocol implementations
 in clojure, store your complex data structures in an off-heap chache,
 read binary files and do
 everything you would usually do `ByteBuffer`.

 Main features & motivation to write it

   * partial deserialization (read and deserialise parts of a byte
 buffer)
   * named access (access parts of your buffer by names)
   * composing/decomposing from key/value pairs
   * pretty hexdump
   * many useful default types that you can combine and extend easily

 Data types include:

   * primitives, such as `int32`, `boolean`, `byte`, `short`, `medium`,
 `float`, `long`
   * arbitrary-length `string`
   * byte arrays
   * composite types (combine any of primitives together)
   * repeated type (repeat any primitive arbitrary amount of times in
 payload)
   * enum type (for mapping between human-readable and binary
 representation of constants)

 Buffy has been serving us well for recent time, and no major issues
 were revealed. However, until
 it reaches GA, we can't guarantee 100% backward compatibility, although
 we're thought it through
 very well and used our best knowledge to make it right.

 Buffy is a ClojureWerkz project, same as Monger, Elastisch, Cassaforte,
 Neocons, Meltdown and
 many others.

 [1] https://github.com/clojurewerkz/buffy
 [2] http://clojurewerkz.org

 --

 Alex P

 http://clojurewerkz.org

 http://twitter.com/ifesdjeen

>>>  --
>> --
>> 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 becau

Re: clojure.java.jdbc 3.0 reusing connections

2013-12-10 Thread Sean Corfield
On Tue, Dec 10, 2013 at 2:17 PM, Andrey Antukh  wrote:
> In my opinion, this has a lot of boilerplate for basic operation like this
> (reuse a connection for few operations).

I'm open to suggestions for idiomatic enhancements (via JIRA).

> The deprecated api of clojure.java.jdbc had some useful methods for do it
> more concise and intuitive, you can use it.

The deprecated API relied heavily on dynamically rebound global
variables which are poor style (which is _why_ that API is
deprecated).

> Also, you can try use a connection pool for avoid this boilerplate or find a
> more concise alternative to clojure.java.jdbc library.

I would certainly recommend using a connection pool. There are two
examples of that in the (community-editable) docs:

http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html#how-to-use-connection-pooling
-- 
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.


Re: odd failure on recursive use of protocol member

2013-12-10 Thread Kevin Downey
extend mutates some state (the protocol definition), so what is happen
here is comp is returning a new function built from the value of the
rest-serialize var (the protocol function before the extend changes it)
and the value of the deref var.

I have not verified this, but I suspect if you use (fn [x]
(rest-serialize (deref x))) instead of the comp version, you will get
the behaviour you expected

On 12/10/13, 11:50 AM, Michael Blume wrote:
> I have a protocol RestSerializable to represent data that can be serialized 
> to json from a REST interface.
> 
> (defprotocol RestSerializable
>   (rest-serialize [this]
>"Convert to something Cheshire can JSONify"))
> 
> By default, things are left alone
> 
> (extend Object
>   RestSerializable
>   {:rest-serialize identity})
> 
> But I want atoms and the like to be transparent when serialized
> 
> (extend clojure.lang.IDeref
>   RestSerializable
>   {:rest-serialize (comp rest-serialize deref)})
> 
> I would expect this to mean that, say, 
> 
> (-> 42 atom atom atom atom rest-serialize)
> 
> would just unwrap to 42, but in fact it only unwraps the outer atom and 
> leaves the inner ones alone.
> 
> Here's where it gets weird though. If I just evaluate the extend 
> clojure.lang.IDeref form again, rest-serialize suddenly gains the ability 
> to unwrap *two* layers of atoms. Eval it again and it can unwrap *three*. 
> Kinda feels like the exercises in Little Schemer when they're building up 
> to the Y Combinator.
> 
> Here's my REPL session demonstrating this (not shown, but I've verified 
> this behavior is the same in Clojure 1.5.1 and Clojure 1.6.0-alpha3)
> 
> $ lein repl
> nREPL server started on port 46049 on host 127.0.0.1
> REPL-y 0.2.1
> Clojure 1.5.1
> Docs: (doc function-name-here)
>   (find-doc "part-of-name-here")
>   Source: (source function-name-here)
>  Javadoc: (javadoc java-object-or-class-here)
> Exit: Control+D or (exit) or (quit)
>  Results: Stored in vars *1, *2, *3, an exception in *e
> 
> user=> (defprotocol RestSerializable
>   #_=>   (rest-serialize [this]
>   #_=>"Convert to something Cheshire can JSONify"))
> RestSerializable
> user=> 
> 
> user=> (extend Object
>   #_=>   RestSerializable
>   #_=>   {:rest-serialize identity})
> nil
> user=> 
> 
> user=> (extend clojure.lang.IDeref
>   #_=>   RestSerializable
>   #_=>   {:rest-serialize (comp rest-serialize deref)})
> nil
> user=> (-> 7 atom atom atom rest-serialize)
> #>
> user=> (-> 7 atom atom atom rest-serialize)
> #>
> user=> (-> 7 atom atom atom rest-serialize)
> #>
> user=> (extend clojure.lang.IDeref
>   #_=>   RestSerializable
>   #_=>   {:rest-serialize (comp rest-serialize deref)})
> nil
> user=> (-> 7 atom atom atom rest-serialize)
> #
> user=> (-> 7 atom atom atom rest-serialize)
> #
> user=> (extend clojure.lang.IDeref
>   #_=>   RestSerializable
>   #_=>   {:rest-serialize (comp rest-serialize deref)})
> nil
> user=> (-> 7 atom atom atom rest-serialize)
> 7
> user=> (quit)
> Bye for now!
> 


-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?



signature.asc
Description: OpenPGP digital signature


Re: odd failure on recursive use of protocol member

2013-12-10 Thread Michael Blume
Oh, interesting. I knew it was changing *some* state but I didn't realize
it was actually changing the binding of the rest-serialize var.  Thanks =)


On Tue, Dec 10, 2013 at 4:09 PM, Kevin Downey  wrote:

> extend mutates some state (the protocol definition), so what is happen
> here is comp is returning a new function built from the value of the
> rest-serialize var (the protocol function before the extend changes it)
> and the value of the deref var.
>
> I have not verified this, but I suspect if you use (fn [x]
> (rest-serialize (deref x))) instead of the comp version, you will get
> the behaviour you expected
>
> On 12/10/13, 11:50 AM, Michael Blume wrote:
> > I have a protocol RestSerializable to represent data that can be
> serialized
> > to json from a REST interface.
> >
> > (defprotocol RestSerializable
> >   (rest-serialize [this]
> >"Convert to something Cheshire can JSONify"))
> >
> > By default, things are left alone
> >
> > (extend Object
> >   RestSerializable
> >   {:rest-serialize identity})
> >
> > But I want atoms and the like to be transparent when serialized
> >
> > (extend clojure.lang.IDeref
> >   RestSerializable
> >   {:rest-serialize (comp rest-serialize deref)})
> >
> > I would expect this to mean that, say,
> >
> > (-> 42 atom atom atom atom rest-serialize)
> >
> > would just unwrap to 42, but in fact it only unwraps the outer atom and
> > leaves the inner ones alone.
> >
> > Here's where it gets weird though. If I just evaluate the extend
> > clojure.lang.IDeref form again, rest-serialize suddenly gains the ability
> > to unwrap *two* layers of atoms. Eval it again and it can unwrap *three*.
> > Kinda feels like the exercises in Little Schemer when they're building up
> > to the Y Combinator.
> >
> > Here's my REPL session demonstrating this (not shown, but I've verified
> > this behavior is the same in Clojure 1.5.1 and Clojure 1.6.0-alpha3)
> >
> > $ lein repl
> > nREPL server started on port 46049 on host 127.0.0.1
> > REPL-y 0.2.1
> > Clojure 1.5.1
> > Docs: (doc function-name-here)
> >   (find-doc "part-of-name-here")
> >   Source: (source function-name-here)
> >  Javadoc: (javadoc java-object-or-class-here)
> > Exit: Control+D or (exit) or (quit)
> >  Results: Stored in vars *1, *2, *3, an exception in *e
> >
> > user=> (defprotocol RestSerializable
> >   #_=>   (rest-serialize [this]
> >   #_=>"Convert to something Cheshire can JSONify"))
> > RestSerializable
> > user=>
> >
> > user=> (extend Object
> >   #_=>   RestSerializable
> >   #_=>   {:rest-serialize identity})
> > nil
> > user=>
> >
> > user=> (extend clojure.lang.IDeref
> >   #_=>   RestSerializable
> >   #_=>   {:rest-serialize (comp rest-serialize deref)})
> > nil
> > user=> (-> 7 atom atom atom rest-serialize)
> > #>
> > user=> (-> 7 atom atom atom rest-serialize)
> > #>
> > user=> (-> 7 atom atom atom rest-serialize)
> > #>
> > user=> (extend clojure.lang.IDeref
> >   #_=>   RestSerializable
> >   #_=>   {:rest-serialize (comp rest-serialize deref)})
> > nil
> > user=> (-> 7 atom atom atom rest-serialize)
> > #
> > user=> (-> 7 atom atom atom rest-serialize)
> > #
> > user=> (extend clojure.lang.IDeref
> >   #_=>   RestSerializable
> >   #_=>   {:rest-serialize (comp rest-serialize deref)})
> > nil
> > user=> (-> 7 atom atom atom rest-serialize)
> > 7
> > user=> (quit)
> > Bye for now!
> >
>
>
> --
> And what is good, Phaedrus,
> And what is not good—
> Need we ask anyone to tell us these things?
>
>

-- 
-- 
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.


Code layout

2013-12-10 Thread Plínio Balduino
Hi there

What is the ideal way to format Clojure code? I'm following Batsov's Style
Guide but, in some moments, it sounds a bit confuse to me.

To the point:

(reduce +
(filter even?
nums))

or

(reduce
  +
  (filter
even?
nums))

Which one is preferable, more correct, expressive or idiomatic?

If you tell me "it really doesn't matter, both are right/wrong", I'll
accept as a completely valid answer.

Thanks in advance

Plínio

-- 
-- 
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: Code layout

2013-12-10 Thread Dan Cross
Why not just,

(reduce + (filter even? nuns))

?

That's a simple enough form I wouldn't bother with the line breaks.


On Tue, Dec 10, 2013 at 9:24 PM, Plínio Balduino wrote:

> Hi there
>
> What is the ideal way to format Clojure code? I'm following Batsov's Style
> Guide but, in some moments, it sounds a bit confuse to me.
>
> To the point:
>
> (reduce +
> (filter even?
> nums))
>
> or
>
> (reduce
>   +
>   (filter
> even?
> nums))
>
> Which one is preferable, more correct, expressive or idiomatic?
>
> If you tell me "it really doesn't matter, both are right/wrong", I'll
> accept as a completely valid answer.
>
> Thanks in advance
>
> Plínio
>
> --
> --
> 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: problem 58 on 4clojure

2013-12-10 Thread Leon Talbot
Hello Ritchie!

I had almost the same:
(fn [& fs] 
(let [f (last fs)
  r (rest (reverse fs))] 
  (fn [& data] (reduce #(%2 %) (apply f data) r

But then I really liked your destructuring, so I'll take it with me:
(fn [& fs] 
(let [[f & r] (reverse fs)] 
  (fn [& data] (reduce #(%2 %) (apply f data) r

Thanks a lot!


Le dimanche 26 août 2012 14:06:20 UTC-4, Sam Ritchie a écrit :
>
> Here's a solution using reduce that handles passing multiple arguments 
> into the rightmost function:
>
> (fn [& fns]
> (fn [& args]
>   (let [[f & fns] (reverse fns)]
> (reduce #(%2 %1) (apply f args) fns
>
> On Sun, Aug 26, 2012 at 9:12 AM, Tyler Perkins 
> 
> > wrote:
>
>> It might help to simplify. Whenever you're accumulating over a
>> sequence of things, think of reduce:
>>
>> (let [__ (fn [& fs]
>>  ;;  Here's the function:
>>  (reduce #(fn [x] (%1 (%2 x))) fs))
>>  ]
>>  ;;  Testing:
>>  [ (= 5 ((__ (partial + 3) second) [1 2 3 4]))
>>(= [3 2 1] ((__ rest reverse) [1 2 3 4]))
>>  ])
>>
>> Each step in the accumulation creates a new function that just applies
>> the current function to an argument that is the result of applying the
>> already-composed ones.
>>
>> --
>> 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
>>
>
>
>
> -- 
> Sam Ritchie, Twitter Inc
> 703.662.1337
> @sritchie
>
> (Too brief? Here's why! http://emailcharter.org)
>
> 

-- 
-- 
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: Code layout

2013-12-10 Thread John Gabriele
On Tuesday, December 10, 2013 9:24:16 PM UTC-5, Plinio Balduino wrote:
>
> Hi there
>
> What is the ideal way to format Clojure code? I'm following Batsov's Style 
> Guide but, in some moments, it sounds a bit confuse to me.
>
> To the point:
>
> (reduce +
> (filter even?
> nums))
>
> or
>
> (reduce 
>   + 
>   (filter 
> even? 
> nums))
>
> Which one is preferable, more correct, expressive or idiomatic?
>
>
In general, I think it's best to vertically align arguments (your first 
example), however, for very simple cases (like this one, where the reduce 
func, the filter func, and the coll are all just symbols), putting it all 
on one line (as Dan suggests) is fine. Any more complicated though I'd 
start vertically-aligning args. :)

-- 
-- 
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: 'neostore' does not contain a store version, please ensure that the original database was shut down in a clean state.

2013-12-10 Thread Himakshi Mangal
Hi, Joseph,

The problem is happening during batch import.

What i did was i started the clojure code in eclipse and started batch 
importing in neo4j.

After processing 2-3 lakhs of lines of a file, the process hangs and even 
the eclipse. Now if i interrupt clojure process or restart the eclipse, i 
think the database is in an inconsistent state.

the shutdown isn't called till now as there are still many records 
remaining to be processed.

can you please suggest a solution to this?


On Tuesday, December 10, 2013 3:30:09 PM UTC+5:30, Himakshi Mangal wrote:
>
> Hi,
>
> I was using clojure to upload the dbpedia datasets into neo4j.
>
> Unfortunately, my system hanged and i had to restart everything. Now, if i 
> start the execution of program again it shows this error:
>
> 'neostore' does not contain a store version, please ensure that the 
> original database was shut down in a clean state.
>
>
> How can i solve this error so that i can start the uploading from the 
> point it stopped?
>
> Please help
>

-- 
-- 
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: 'neostore' does not contain a store version, please ensure that the original database was shut down in a clean state.

2013-12-10 Thread Himakshi Mangal
Hi wes,

I tried with neo4j-shell but it gave me this error: 
Error starting org.neo4j.kernel.EmbeddedGraphDatabase, 
/home/himakshi/work/setup/neo4j-community-2.0.0-RC1/bin/../data/dbpedia.db

Yes, I am using org.neo4j.unsafe.BatchInserter. 

If this causes the problem, can there be any alternate solution because i 
cannot afford to loose my db after 3-lakhs records are already processed.



On Tuesday, December 10, 2013 3:30:09 PM UTC+5:30, Himakshi Mangal wrote:
>
> Hi,
>
> I was using clojure to upload the dbpedia datasets into neo4j.
>
> Unfortunately, my system hanged and i had to restart everything. Now, if i 
> start the execution of program again it shows this error:
>
> 'neostore' does not contain a store version, please ensure that the 
> original database was shut down in a clean state.
>
>
> How can i solve this error so that i can start the uploading from the 
> point it stopped?
>
> Please help
>

-- 
-- 
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: Code layout

2013-12-10 Thread Russell Mull
I sometimes find that, when the formatting gets hairy, I need to either 
refactor my code or use one of the pipeline macros. 

(->> nums
 (filter even?)
 (reduce +))

- Russell

On Wednesday, December 11, 2013 11:24:16 AM UTC+9, Plinio Balduino wrote:
>
> Hi there
>
> What is the ideal way to format Clojure code? I'm following Batsov's Style 
> Guide but, in some moments, it sounds a bit confuse to me.
>
> To the point:
>
> (reduce +
> (filter even?
> nums))
>
> or
>
> (reduce 
>   + 
>   (filter 
> even? 
> nums))
>
> Which one is preferable, more correct, expressive or idiomatic?
>
> If you tell me "it really doesn't matter, both are right/wrong", I'll 
> accept as a completely valid answer.
>
> Thanks in advance
>
> Plínio
>

-- 
-- 
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: Code layout

2013-12-10 Thread Laurent PETIT
It really doesn't matter, both are right/wrong


Le mercredi 11 décembre 2013, Plínio Balduino a écrit :

> Hi there
>
> What is the ideal way to format Clojure code? I'm following Batsov's Style
> Guide but, in some moments, it sounds a bit confuse to me.
>
> To the point:
>
> (reduce +
> (filter even?
> nums))
>
> or
>
> (reduce
>   +
>   (filter
> even?
> nums))
>
> Which one is preferable, more correct, expressive or idiomatic?
>
> If you tell me "it really doesn't matter, both are right/wrong", I'll
> accept as a completely valid answer.
>
> Thanks in advance
>
> Plínio
>
> --
> --
> 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 '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  'clojure%2bunsubscr...@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  'clojure%2bunsubscr...@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: Code layout

2013-12-10 Thread Mark Engelberg
Put as much as is legible on one line.  If you need to break lines, break
after the function name, not after the first parameter, in order to
minimize rightward drift.

-- 
-- 
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.