re: Fibonacci in Every Language VIEW POST

FULL DISCUSSION
 

Racket:

(define (fib n)
  (define (fib-iter i n current previous)
    (if (>= i n)
        current
        (fib-iter (+ i 1) n (+ current previous) current)))
  (fib-iter 0 n 1 0))
code of conduct - report abuse