summaryrefslogtreecommitdiff
path: root/test/fib.myr
blob: 979c3792a15a7c5435405d48befe848caddf725b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std
/* checks if recursive functions work. should return 21. */
const fib = {n
	if n <= 0
		-> 0
	elif n == 1
		-> 1
	else
		-> fib(n - 1) + fib(n - 2)
	;;
}

const main = {
	std.exit(fib(8))
}