about summary refs log tree commit diff
path: root/examples/5.src
blob: fe07d38b7c2ceaf2e5eebc1989cacd9be30aa650 (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, i64) => i64;

let x = 18;

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

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