~jojo/Carth

ref: c5a394b01aa60cb95605d66f6118cfb231955aa7 Carth/examples/sicp.carth -rw-r--r-- 175 bytes
c5a394b0JoJo Fix class constraint inference bug when explicit scheme given 8 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))))))