about summary refs log tree commit diff
path: root/examples/5.src
blob: a8d341d393393f866f5d56612ebb43897eb64f0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* As you see, the language supports variable scopes */
extern printf = (*i64, varargs) => i64;

let x = 18;

let foo = () => i64 {
	let x = 1;
	printf("%d\n", x);
	return x;
};

let main = () => i64 {
	printf("%d\n", x);
	let x = 2;
	let y = foo();
	printf("%d\n", x);
	return x + y;
};