Re: Debugging in Clojure

2010-01-24 Thread Timothy Pratley
2010/1/23 ataggart alex.tagg...@gmail.com:  If the authors of of c.c.trace are amenable, I'm inclined to add this functionality to a variant of the c.c.logging/spy macro Great idea! -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Debugging in Clojure

2010-01-24 Thread Gabi
Be careful of deftrace. It has a bug that crashes when the defn'ed funcs have string comment on the top of the func On Jan 23, 7:02 am, ataggart alex.tagg...@gmail.com wrote: On Jan 22, 6:27 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Fri, 22 Jan 2010 17:25:39 -0800

Re: Debugging in Clojure

2010-01-24 Thread e
It has confused me since the day I tried to mess around with clojure that this topic isn't brought up more (not that I follow clj regularly) ... so I'm happy to learn that someone added trace capabilities. That said (and I'm not trying to make this a charged statement ... just a way to learn

Re: Debugging in Clojure

2010-01-24 Thread Richard Newman
That said (and I'm not trying to make this a charged statement ... just a way to learn more) I had always thought that one of the key things that made lisp so complete was that programs don't just crash ... that debugging is fully-baked into the *core* of everything. Now, I don't remember

Re: Debugging in Clojure

2010-01-24 Thread e
interesting. thanks for the thoughtful reply. On Sun, Jan 24, 2010 at 2:08 PM, Richard Newman holyg...@gmail.com wrote: That said (and I'm not trying to make this a charged statement ... just a way to learn more) I had always thought that one of the key things that made lisp so complete was

Re: Debugging in Clojure

2010-01-23 Thread Jeff Rose
On Jan 22, 1:40 pm, Krukow karl.kru...@gmail.com wrote: Please don't top post. Seriously, people still complain about this? It's the default behavior in Google Groups, so I think you just have to live with it. Find a news reader that doesn't suck. -- You received this message because you are

Re: Debugging in Clojure

2010-01-22 Thread Heinz N. Gies
On Jan 22, 2010, at 9:08 , Miron Brezuleanu wrote: I also use 'do's as others have suggested. Another trick is to add dummy variables in lets just to be able to print something. For instance, (let [a 1 b 2 dummy1 (println stuff) c 3] ...) Isn't the ideomatic way

Re: Debugging in Clojure

2010-01-22 Thread Konrad Scorciapino
it's quite simple. On Thu, Jan 21, 2010 at 8:27 PM, ajay gopalakrishnan ajgop...@gmail.comwrote: Is this the preferred way of debugging in Clojure? On Thu, Jan 21, 2010 at 5:25 PM, Richard Newman holyg...@gmail.comwrote: I usually debug by adding println statements. How can I

Re: Debugging in Clojure

2010-01-22 Thread Krukow
On Jan 22, 2:27 am, ajay gopalakrishnan ajgop...@gmail.com wrote: Is this the preferred way of debugging in Clojure? Please don't top post. I've heard people have success with regular debuggers, e.g. JSwat, although I haven't tried this myself... /Karl -- You received this message because

Re: Debugging in Clojure

2010-01-22 Thread Mike Meyer
On Fri, 22 Jan 2010 10:08:45 +0200 Miron Brezuleanu mbr...@gmail.com wrote: Hello, On Fri, Jan 22, 2010 at 3:14 AM, ajay gopalakrishnan ajgop...@gmail.comwrote: Hi, I usually debug by adding println statements. How can I achieve the same effect in Clojure. I don't think I can

Re: Debugging in Clojure

2010-01-22 Thread ataggart
On Jan 22, 4:13 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Fri, 22 Jan 2010 10:08:45 +0200 Miron Brezuleanu mbr...@gmail.com wrote: Hello, On Fri, Jan 22, 2010 at 3:14 AM, ajay gopalakrishnan ajgop...@gmail.comwrote: Hi, I usually debug by adding

Re: Debugging in Clojure

2010-01-22 Thread ajay gopalakrishnan
I dont mind using println. The problem is that needs to be inside a do or when ... and that is not really part of my code. When the time comes to remove the prints, i need to remove all these do blocks too. I can leave them as it is I guess, but then it is not neat and non-idiomatic. From all the

Re: Debugging in Clojure

2010-01-22 Thread ataggart
...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en Debugging is not exactly the same as logging (though the latter might help with the former). I infer you mean logging, hence you should use a logging library that allows you to *leave

Re: Debugging in Clojure

2010-01-22 Thread Stefan Kamphausen
Hi, On Jan 22, 2:14 am, ajay gopalakrishnan ajgop...@gmail.com wrote: I usually debug by adding println statements. if you use Emacs is this statement is true for other programming languages, too, you might be interested in using lldebug. I'm pretty sure, that when you ask the author to add

Re: Debugging in Clojure

2010-01-22 Thread Mike Meyer
On Fri, 22 Jan 2010 17:25:39 -0800 ajay gopalakrishnan ajgop...@gmail.com wrote: I dont mind using println. The problem is that needs to be inside a do or when ... and that is not really part of my code. When the time comes to remove the prints, i need to remove all these do blocks too. I can

Re: Debugging in Clojure

2010-01-22 Thread ataggart
On Jan 22, 6:27 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Fri, 22 Jan 2010 17:25:39 -0800 ajay gopalakrishnan ajgop...@gmail.com wrote: I dont mind using println. The problem is that needs to be inside a do or when ... and that is not really part of my code. When

Debugging in Clojure

2010-01-21 Thread ajay gopalakrishnan
Hi, I usually debug by adding println statements. How can I achieve the same effect in Clojure. I don't think I can introduce println at arbitrary places to figure out at which step is the algorithm failing. Thanks, Ajay -- You received this message because you are subscribed to the Google

Re: Debugging in Clojure

2010-01-21 Thread Richard Newman
I usually debug by adding println statements. How can I achieve the same effect in Clojure. I don't think I can introduce println at arbitrary places to figure out at which step is the algorithm failing. Sure you can. You might need to add a (do ) block if you're wanting to add them in an

Re: Debugging in Clojure

2010-01-21 Thread ajay gopalakrishnan
Is this the preferred way of debugging in Clojure? On Thu, Jan 21, 2010 at 5:25 PM, Richard Newman holyg...@gmail.com wrote: I usually debug by adding println statements. How can I achieve the same effect in Clojure. I don't think I can introduce println at arbitrary places to figure out

Re: Debugging in Clojure

2010-01-21 Thread .Bill Smith
I don't know about *the* preferred way, but it's my preferred way. It's a no-brainer to add print statements. I believe there is at least one logging library available too. On Jan 21, 7:27 pm, ajay gopalakrishnan ajgop...@gmail.com wrote: Is this the preferred way of debugging in Clojure

Re: Debugging in Clojure

2010-01-21 Thread ataggart
Logging side-effects usually occur within a do block, or the equivalent, e.g., when, catch. For production code, I'd suggest a logging library instead of filling your code with printlns. Contrib has a logging lib that delegates to common java logging libraries, but allows for writing them in a

Re: Debugging in Clojure

2010-01-21 Thread David Nolen
I find that injecting print statements is painful if you're not using something like paredit (Emacs). With paredit it's quite simple. On Thu, Jan 21, 2010 at 8:27 PM, ajay gopalakrishnan ajgop...@gmail.comwrote: Is this the preferred way of debugging in Clojure? On Thu, Jan 21, 2010 at 5:25