blob: 71545c6a3320272b1b15b67edd48b6dd8e27fdaf (
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
31
32
33
34
35
36
37
38
39
40
|
puti @= fn(x: int) {
#C("printf(\"%ld\\n\", (long)x);
");
};
putch @= fn(x: char) {
#C("printf(\"%c\\n\", x);
");
};
putf @= fn(x: float) {
#C("printf(\"%f\\n\", (double)x);
");
};
foo @= fn() int {
N := 10;
numbers := new(int, N);
i := 0;
while i < N {
numbers[i] = i;
i = i + 1;
}
numbers[5:7][1] + numbers[2:][0] + numbers[:6][3]
};
main @= fn() {
N @= 5;
puti(N);
x : [foo()]int;
puti(foo());
teststr := "Hello!";
i := 0;
while i < 5 {
putch(teststr[i]);
i = i + 1;
}
y:int=5+#C("(1<<3)");
puti(y);
};
|