ncomp would be faster if it's implemented a la exponentiation by squaring.
On Mon, Nov 16, 2015 at 12:55 PM, Ben Wolfson wrote:
> If you rearrange the arguments of your proposed three-argument iterate:
>
> (defn iterate
> ...
> ([f n x]
>(if (zero? n)
> x
> (recur f (f x) (dec
If you rearrange the arguments of your proposed three-argument iterate:
(defn iterate
...
([f n x]
(if (zero? n)
x
(recur f (f x) (dec n
it supports partial application of the multiply-composed function to
different arguments more easily, which suggests redefinition as:
(def