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:
ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn
The Code
(defn calculate-salary
[years salary]
(if (= years 0)
(salary)
(calculate-salary (- years 1) (* salary 2))))
I'm very new to Clojure so I'm sure its something simple, but I just can't seem to figure it out.