I basically want this:
(defn mymax ([ab] (if (> ab) ab)) ([ab & rest] (apply recur (conj rest (mymax ab)))))
So: (mymax 1 2 3 4) tail calls (mymax 2 3 4) , which calls tail (mymax 3 4)
I see a problem in which "apply" stops the repetition in the tail position, which means that it will not work. But I do not see how I can not use the application for variable function arguments
[Please note, I know that you can solve this specific problem with reduction. Just wondering if you can do tail-call-recursion with params variables]
source share