Quote:
|
Originally Posted by phrontist
A holy war, the one I've been waiting for, is here!
|
Come, now. Usually I like to stay out of holy wars and such ... but for shame! did you have to bad mouth Lisp? Once you get your eyes fixed after looking at a program or two, it ain't all that bad ... actually, it can be quite powerful. I especially like Scheme (a dialect of Common Lisp). Hrm ... how odd that I put that in parentheses, no?
Afterall, who can resist tail-end recursion and the ability to say cadr, caaddr, etc. as freely as one pleases?
Code:
(define (factorial n)
(define (iterate n acc)
(if (<= n 1)
acc
(iterate (- n 1) (* acc n))))
(iterate n 1))