summaryrefslogtreecommitdiff
path: root/test.toc
blob: 52672d862d9e0bfa71555e5615d1516807128646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "std/io.toc";

f ::= fn(x : ..) int {
  total := 0;
  for a := x {
  	  total += a as int;
  }
  total
};

main ::= fn() {
	 puti(f(1,2,3));
	 puti(f(1,2,3,4,5,6));
	 puti(f(1,2,3,4));
	 puti(f(1,7,3));
	 puti(f(1,2,4,4,5,6));
	 puti(f(1,2,-7.3,4.656));

	 puti(f(7.3,4.656));
};