I have a function that takes the number of years and salary, then recursively doubles the salary until years is exhausted. However, I keep getting this error:
Since you are new I rewrote your function to be a bit more idiomatic. Also, it uses recur so it will not consume the call stack.
(defn calculate-salary
[years salary]
(if (zero? years)
salary
(recur (dec years) (* salary 2))))
Notice the use of the zero? predicate, recur, and dec
EDIT: typos and grammar