summaryrefslogtreecommitdiff
path: root/test.toc
blob: a30d6eec7286e7c60b3205ce08c0c26d68d3a038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "std/io.toc";
/*
sum ::= fn(n::=, t::=, a: [n]t) t {
	total : t = 0;
	for x := a {
		total += x;
	}
	total
}

main ::= fn() {
	t ::= int;
	numbers : [1000]t;
	for x, i : (&t, t) = &numbers {
		*x = i;
	}
	puti(sum(numbers) as int);

}
*/
Point ::= struct {
	x, y : int;
}

main ::= fn() {
	p: Point;
	p.x = 12 + e;
}