In this particular case, you're missing a do
in the "else" clause of the if
:
(do
(println input)
(recur))
Without the do
, you've got ((println input) (recur))
, which looks like a function call with the return value of (println input)
being the function to call and (recur)
being the argument expression and so, not in tail position.
(Clearly (println input)
would return nil
and attempting to call that as a function would throw a NullPointerException
, but this is irrelevant here -- it would be a runtime error, whereas the recur
-not-in-tail-position problem is detectable at compile time.)