Tech behind Tech

Raw information. No finesse :)

Debug Repl — debugging clojure code

leave a comment »

Lets first make sure we need a debugging tool. I for one believe (addicted) to test driven development. I should not say believe, in fact my mind works better when I write tests. Writing tests force to me to think all different scenarios code could be executed and what should be the outcome. So I have good test coverage and it is easy to debug my code when a test fail. As I will know exactly where the problem is. But when I am running my code in context of some environment it is difficult to find issues. That is when I use poor man’s debugging tool (yes I am talking about println) and try to find what is causing issue. So there is a need for a debugging tool …

My friend and colleague George introduced to me to debug-repl. In fact he wrote it. It is so simple to use. Include

(use 'alex-and-georges.debug-repl)

and put


where you want debug repl to start. When you run code, debug repl will stop the execution of code and will start a repl. Now you are free to see what values are set etc.

Check it out …

You can find debug repl at

Happy debugging … (but write tests … no excuses)

Written by Siva Jagadeesan

May 27, 2010 at 6:16 am

Posted in Clojure

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 147 other followers

%d bloggers like this: