re: Challenge: Write the recursive Fibonacci algorithm in a different language. VIEW POST

FULL DISCUSSION
 

Common Lisp!

(defun fib (n &optional (curr 0) (next 1)) 
  (if (zerop n) 
      curr 
      (fib (1- n) next (+ curr next))))

(and for the TCO crowd... it's implementation dependent, so YMMV)

code of conduct - report abuse