1

I'm using CIDER for Clojure programming. I've been playing around with the CIDER debugger lately. I wanted to use the conditional breakpoint facility with some simple recursive function, such as factorial, so I got the following:

(defn factorial [n]
  #dbg ^{:break/when (< n 3)}(if (zero? n)
    1
    (* n (factorial (dec n)))))

It works correctly when I directly supply an argument that meets the requirement upon first function call, but apparently it does not work upon recursive function calls. So if I run e.g. (factorial 10), the execution never stops at the breakpoint. Is this a known limitation of the CIDER debugger, like some tricky way in which it instruments the code? More importantly, is there any way to make it work with recursive functions?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.