]> Witch of Git - ivy/blob - program.vy
An s-expression parser and an example program
[ivy] / program.vy
1 (let ([nil (lam (c n) (n))]
2 [cons (lam (x y) (lam (c n) (c x y)))]
3 [fix (lam (f) (f f))]
4 [if (lam (c t f) ((c t f)))]
5 [true (lam (t f) t)]
6 [false (lam (t f) f)])
7 ([fix (lam (recur a b l n)
8 (if (<= n 0)
9 [lam () l]
10 [lam () (recur b (+ a b) (cons a l) (- n 1))]))]
11 0 1 nil 20))