Tag: Clojure

  • Loop in Clojure

    Loop in Clojure

    Here’s a way to avoid recursive helper functions… By using loop in Clojure. Sometimes recursive helper functions seem needed, like fibonacci-iter: (I ported this to Clojure from Structure and Interpretation of Computer Programs, licensed CC BY-SA-4.0) That fibonacci-iter helper function is only needed for recursion. For example, the public (defn fibonacci [n] only needs an…