Re: restarts

2014-06-20 Thread Stefan Kamphausen
On Thursday, June 19, 2014 11:05:07 PM UTC+2, Thomas Heller wrote: > > Excuse my ignorance of not knowing anything about CL and restarts but I > needed something like retry a while back. > Restarts in CL are a different beast. Take a look at e.g. http://www.gigamonkeys.com/book/beyond-exceptio

leiningen project hooks

2014-06-20 Thread Phillip Lord
I've been struggling with leiningen project hooks as I believe that I need them for my current project. I am writing an manual with code examples, using a literate programming technology. The main source is in asciidoc, but I can untangle these to produce valid clojure, which I can then evaluate

Re: macro - unquote

2014-06-20 Thread sorin cristea
http://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html On Thursday, June 19, 2014 12:22:36 PM UTC+3, sorin cristea wrote: > > > > hi all, > related to macro definition, what are the differences between*[** ' ]* > char and *[ ` ]* char ? > > thanks. > -- You received

Re: restarts

2014-06-20 Thread Thomas Heller
Don't want to get into a debate about whether something is a good idea or not, but that "beast" seems to go against clojures "data-all-the-things". In their example, you'd move a side effect into an otherwise "pure" function of taking text and turning it into data. Maybe a little different solutio

Record and hash-map memory usage

2014-06-20 Thread ducky
Hi, I am trying to understand the difference in memory usage between a defrecord and a hashmap in Clojure 1.6. (I am a Clojure and a Java newbie). I've read in Joy of Clojure that a record consumes less memory than a hash-map. I've also read in prismatic eng-practices data representation guide

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread gvim
On 18/06/2014 17:07, Gary Trakhman wrote: Try http://clojuredocs.org/clojure_core/clojure.core/for I couldn't get anywhere near what was so easy in Ruby. Nested enumeration seems difficult in Clojure. gvim -- You received this message because you are subscribed to the Google Groups "Cloju

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread Timothy Baldridge
Care to explain? How does it get much simpler than: (for [x some-collection y x z y] z) On Fri, Jun 20, 2014 at 5:52 AM, gvim wrote: > On 18/06/2014 17:07, Gary Trakhman wrote: > >> Try http://clojuredocs.org/clojure_core/clojure.core/for >> >> >> > I couldn't get anywhere near

Best tools for profiling Clojure programs?

2014-06-20 Thread ru
Hi all, What performance profiling instrument somebody can recommend for Clojure programs and corresponding documents, articles or tutorials. Thanks in advance. Sincerely, Ru -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread gvim
On 20/06/2014 13:38, Timothy Baldridge wrote: Care to explain? How does it get much simpler than: (for [x some-collection y x z y] z) Because it's 3 levels deep and requires substituting the vars back into maps to then create a returned map. Your for example doesn't emulate

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread François Rey
On 20/06/14 15:11, gvim wrote: Because it's 3 levels deep and requires substituting the vars back into maps to then create a returned map. Your for example doesn't emulate Ruby's each_with_index, as in the example, as far as I'm aware. I'm fairly new to Clojure so the obvious may not be so obvi

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread Dave Della Costa
Rather than start with the code you are trying to duplicate, consider the data structure(s) that you have as input and the data structure you want to end up with. It's certainly possible to emulate the kind of nested loop structure you are asking about in Clojure, but most likely it's not how you'

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread Dave Della Costa
Sorry, the first example fn is confusing--I'd probably use assoc rather than update-in: > (reduce #(assoc %1 %2 (do-aspected-stuff ...)) {} personals)) (2014/06/20 22:28), Dave Della Costa wrote: > Rather than start with the code you are trying to duplicate, consider > the data structure(s) th

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread gvim
On 20/06/2014 14:28, Dave Della Costa wrote: Rather than start with the code you are trying to duplicate, consider the data structure(s) that you have as input and the data structure you want to end up with. It's certainly possible to emulate the kind of nested loop structure you are asking abou

Best tools for profiling Clojure programs?

2014-06-20 Thread Mike Fikes
I can speak to existence but not optimality :) I've use JProfiler, and my experience is that, just like debuggers work, so does this particular profiler. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

Re: Clojure equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread Gary Trakhman
I don't think you need plumbing for this. On Friday, June 20, 2014, gvim wrote: > On 20/06/2014 14:28, Dave Della Costa wrote: > >> Rather than start with the code you are trying to duplicate, consider >> the data structure(s) that you have as input and the data structure you >> want to end up w

Re: Workflow: cljx, cljsbuild & tdd in one process

2014-06-20 Thread Gary Trakhman
You can get some manner of memory pressure relief by using the G1GC (which lets the OS reclaim memory) and forcing GC's once in a while. Leiningen has 2 JVMs. In my ~/.emacs.d/init.el: (setenv "LEIN_JVM_OPTS" "-XX:+UseG1GC") will catch the leiningen JVM. In my ~/.lein/profiles.clj :jvm-opts ["-

Workflow: cljx, cljsbuild & tdd in one process

2014-06-20 Thread Michal Till
Hello, Based on my previous experience with Ruby, JavaScript etc. I have set up my workflow in a way that it runs three different processes: lein cljx auto - translates the sources to clj and cljs lein cljsbuild auto dev - reads cljs output of ^^ and compiles it on every file change lein midje

Re: Workflow: cljx, cljsbuild & tdd in one process

2014-06-20 Thread Michael Griffiths
There's also a Leiningen plugin called lein-pdo that lets you run tasks in parallel: https://github.com/Raynes/lein-pdo Example usage for cljx auto & cljsbuild auto: https://github.com/DomKM/omelette/blob/master/project.clj#L59 -- You received this message because you are subscribed to the Go

How to know if an agent throw an exception?

2014-06-20 Thread Hussein B.
Hi, When using send-off of an Agent, how to know if any exception is happened? Since AFAIK, agents are executed in different thread. Currently, I'm calling (agent-error) but nothing is logged. Maybe nothing went wrong but some how I'm sure something went wrong. Thank you. -- You received thi

How to tackle this concurrency problem?

2014-06-20 Thread Hussein B.
Hi, I have a ref that saves the ID of last processed event. Of course, I'm using Clojure STM facility. The problem now is I can't control the value of the ref. Due massive concurrency, it is updated and my logic is broken. How to guard, and really guard the update of that ref? Should I do (lo

OOM problem with test.check

2014-06-20 Thread Colin Fleming
Hi all, I'm trying to use test.check to create random objects to test some serialisation code I'm having problems with. In the past, generative testing has worked really well for me for exactly this use case. However, I'm finding that I'm getting OutOfMemoryError when trying to test a lot of itera

Re: How to tackle this concurrency problem?

2014-06-20 Thread James Reeves
What do you mean by "I can't control the value of the ref"? Could you provide some code to show what you mean? - James On 20 June 2014 18:10, Hussein B. wrote: > Hi, > > I have a ref that saves the ID of last processed event. > > Of course, I'm using Clojure STM facility. The problem now is I

Re: How to know if an agent throw an exception?

2014-06-20 Thread Gary Trakhman
You should give it an error-handler: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/agent On Fri, Jun 20, 2014 at 12:46 PM, Hussein B. wrote: > Hi, > > When using send-off of an Agent, how to know if any exception is happened? > Since AFAIK, agents are executed in different

Supplied-p parameter in clojure similar to lisp lambda lists

2014-06-20 Thread Dave Tenny
What is the commonly accepted technique for declaring/using 'supplied-p' type lambda list functionality in clojure? http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-4-1.html I have some clojure functions with a large number of keywords and various defaults, I want to kno

Re: How to tackle this concurrency problem?

2014-06-20 Thread Joe Smith
Maybe you want an Agent. On Jun 20, 2014, at 12:10 PM, Hussein B. wrote: > Hi, > > I have a ref that saves the ID of last processed event. > > Of course, I'm using Clojure STM facility. The problem now is I can't control > the value of the ref. Due massive concurrency, it is updated and my lo

Invalid timestamp

2014-06-20 Thread sindhu hosamane
Hello, i am dealing with timestamp in my cascalog query . My code snippet looks like (def datefrom "2010:05:03 13:20:47") (def custom-formatter (f/formatter ":MM:dd HH:mm:ss")) (def start-value (ct/to-long (f/parse custom-formatter datefrom))) (def dateto "2012:09:01 08:17:

Re: Is it the right Clojure group for a newbie

2014-06-20 Thread Sam Ritchie
Awesome book :) I started my Clojure journey by going to Nicaragua for two weeks with the Little Schemer and a pad of paper. I'd spend a couple of hours by the beach each morning, writing lisp out by hand. You'll be in a pretty good head space for it by the time you get back. douglas smith

Re: Invalid timestamp

2014-06-20 Thread Mike Fikes
It it perhaps reading the first line of your file and running it trough the parser? -- 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

Re: Invalid timestamp

2014-06-20 Thread Sam Ritchie
yup, responded as such on the Cascalog list. (That's a better place for these questions; no need to cross post to the main group.) Mike Fikes June 20, 2014 at 5:57 PM It it perhaps reading the first line of your file and running it trough the parser? -- You received

Re: Is it the right Clojure group for a newbie

2014-06-20 Thread Jeff Heon
As far as I know, this book is not free to distribute. On Friday, June 6, 2014 9:32:27 AM UTC-4, douglas smith wrote: > > here is pdf of Little Schemer > > http://scottn.us/downloads/The_Little_Schemer.pdf > > > On Friday, June 6, 2014 9:17:58 AM UTC-4, douglas smith wrote: >> >> Sounds like we ar