~jojo/Carth

ref: 749208029494a7c48ce04444a513424f4b998416 Carth/examples/sicp.carth -rw-r--r-- 175 bytes
74920802JoJo update TODO 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
(import std)

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

(define fib
  (fmatch
    (case 0 0)
    (case 1 1)
    (case n (+ (fib (- n 1))
               (fib (- n 2))))))