As I understand it, loop .. recur uses tail recursion, so your program didnโt blow the stack, and regular recursion didnโt. Some solutions to problems on 4clojure exit without using loop .. recur , because - I accept a reasonable assumption - the solution can only be deduced using a direct, recursive function call instead of loop .. recur .
From what I read, in some of the Clojure books from a few years ago, you are free to use loop .. recur .
However, at least from the discussion in those books that I read, and from the answers I received to my Clojure questions here in SO, there is some general agreement to try to solve your problem first, using constructs like map , If this is not possible, then be sure to use loop .. recur , and if you do not think it is possible to blow your stack, call direct recursion.
source share