summaryrefslogtreecommitdiff
path: root/test/closurerec.myr
blob: 61fc45e250dbadecd135d2e29d75c7b093046268 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std

const main = {
	const fib = {n
		if n <= 0
			-> 0
		elif n == 1
			-> 1
		else
			-> fib(n - 1) + fib(n - 2)
		;;
	}
	std.exit(fib(8))
}