aboutsummaryrefslogtreecommitdiff
path: root/examples/learn/30-typed-closure.zc
blob: a2c090de0958079c4b42f3744a8dc6e5a2f06e63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
namespace;
include rt;

word.u multiplier(int factor) {
	let scale = fn:int(int n) { return n * factor; };
	return u*scale;
}

fn main() {
	let scale = multiplier(3);
	rt.put_n(scale(14)); rt.put_c(10);
}