~jojo/Carth

ref: 2ffd86d155a095c6a5293cc68fe7ac02daed235e Carth/test/tests/good/fibonacci.carth -rw-r--r-- 193 bytes
2ffd86d1JoJo Fix partitionWith reversing lists. Caused def order issue in genInit 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
;; 7540113804746346429

(import std)

(define main
  (display (show-int (fib 92))))

(define fib
  (define (fib' a b n)
    (if (= n 0)
        a
      (fib' b (+ a b) (dec n))))
  (fib' 0 1))