Is it possible to define two functions in clojure that call each other recursively? For example, this pair:
(defn a [x] (if (= 0 x) 0 (b (dec x)))) (defn b [x] (if (= 0 x) 0 (a (dec x))))
Fail compilation:
Unable to resolve symbol: b in this context
Since I did not define b when I try to call it in a .
for example, in ruby ββthis works fine:
def a(x) x == 0 ? x : b(x-1) end def b(x) x == 0 ? x : a(x-1) end
spike source share