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 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 that program

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 remembe

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 mor

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 wrote: > On Jan 22, 6:27 pm, Mike Meyer > > > 620...@mired.org> wrote: > > On Fri, 22 Jan 2010 17:25:39 -0800 > > > ajay gopalakrishnan wrote: > > > I

Re: Debugging in Clojure

2010-01-24 Thread Timothy Pratley
2010/1/23 ataggart : > 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 group, send email to

Re: Debugging in Clojure

2010-01-23 Thread Jeff Rose
On Jan 22, 1:40 pm, Krukow 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 subscribed to the Goo

Re: Debugging in Clojure

2010-01-22 Thread ataggart
On Jan 22, 6:27 pm, Mike Meyer wrote: > On Fri, 22 Jan 2010 17:25:39 -0800 > > ajay gopalakrishnan 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 re

Re: Debugging in Clojure

2010-01-22 Thread Mike Meyer
On Fri, 22 Jan 2010 17:25:39 -0800 ajay gopalakrishnan 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 leave > them as

Re: Debugging in Clojure

2010-01-22 Thread Stefan Kamphausen
Hi, On Jan 22, 2:14 am, ajay gopalakrishnan 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 support for Clojure

Re: Debugging in Clojure

2010-01-22 Thread ataggart
On Jan 22, 5:25 pm, ajay gopalakrishnan 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 leave > them as it is I guess,

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 r

Re: Debugging in Clojure

2010-01-22 Thread ataggart
On Jan 22, 4:13 pm, Mike Meyer wrote: > On Fri, 22 Jan 2010 10:08:45 +0200 > > > > > > Miron Brezuleanu wrote: > > Hello, > > > On Fri, Jan 22, 2010 at 3:14 AM, ajay gopalakrishnan > > wrote: > > > > Hi, > > > > I usually debug by adding println statements. How can I achieve the same > > > eff

Re: Debugging in Clojure

2010-01-22 Thread Mike Meyer
On Fri, 22 Jan 2010 10:08:45 +0200 Miron Brezuleanu wrote: > Hello, > > On Fri, Jan 22, 2010 at 3:14 AM, ajay gopalakrishnan > wrote: > > > 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 arbit

Re: Debugging in Clojure

2010-01-22 Thread Krukow
On Jan 22, 2:27 am, ajay gopalakrishnan 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 you are subscribed

Re: Debugging in Clojure

2010-01-22 Thread Konrad Scorciapino
(comment) and #_ are pretty useful to disable forms when debugging: (+ 3 #_4) -> 3 (comment println "hi") -> nil Excerpts from David Nolen's message of Fri Jan 22 02:38:29 -0300 2010: > I find that injecting print statements is painful if you're not using > something like paredit (Emacs). With pa

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 ideo

Re: Debugging in Clojure

2010-01-22 Thread Miron Brezuleanu
Hello, On Fri, Jan 22, 2010 at 3:14 AM, ajay gopalakrishnan wrote: > 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. > I also us

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 wrote: > Is this the preferred way of debugging in Clojure? > > > On Thu, Jan 21, 2010 at 5:25 PM, Richard New

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 mo

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 wrote: > Is this the preferred way of debugging in Clojure? > > On Thu, Jan 21, 201

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 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 at which step is t

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 (