summaryrefslogtreecommitdiff
path: root/test.toc
blob: 10043dad52d96f259945ddbf328a47bf43d6a421 (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
29
30
#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);

}
*/

ll ::= struct (t::Type) {
	head: t;
	next: &ll(t);
}

main ::= fn() {
	x: ll(int);
}