Mostly because it's fun, and it will make recursion your best friend!
I just started learning R5RS Scheme and it's kind of awesome, I started noticing all the little things in my program, started using recursion and made a little pow function -.-
(define loopow
(lambda (count x n xpow)
(if (< count (- n 1) )
(loopow (+ count 1) x n (* x xpow))
(abs xpow))
)
)
(define (pow x n) (loopow 0 x n x))
(lambda (count x n xpow)
(if (< count (- n 1) )
(loopow (+ count 1) x n (* x xpow))
(abs xpow))
)
)
(define (pow x n) (loopow 0 x n x))
Having to call the function from another function was a shock for me, I'm not used for it in C, but the complete product is pretty awesome and I'm proud of myself being able to write it.
Recursion FTW!