(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 paredit it's quite simple.
> 
> On Thu, Jan 21, 2010 at 8:27 PM, ajay gopalakrishnan 
> <ajgop...@gmail.com>wrote:
> 
> > 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 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 (if), but that's no different to any other form in an (if).
> >>
> >> The only other consideration is laziness: your printlns might not fire
> >> when you think they should.
> >>
> >> --
> >> 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<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 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<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 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

Reply via email to