summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc25
1 files changed, 6 insertions, 19 deletions
diff --git a/test.toc b/test.toc
index 48e0e1e..87e4e47 100644
--- a/test.toc
+++ b/test.toc
@@ -13,30 +13,17 @@ putf @= fn(x: float) {
");
};
-sum @= fn(x: []int, n: int) int {
- p := &x[0];
- end := &x[n-1];
- total := 0;
- while p <= end {
- total = total + *p;
- p = p + 1;
- }
- total
+ptriple @= fn(m: int, n: int) (int, int, int) {
+ m*m-n*n, 2*m*n, m*m+n*n
};
f @= fn() int {
- N @= 10;
-
- numbers := new(int, N);
- i := 0;
- while i < N {
- numbers[i] = i;
- i = i + 1;
- }
- sum(numbers, N)
+ a, b, c : int;
+ a, b, c = ptriple(3, 2);
+ a + b + c
};
main @= fn() {
- a: [f()]int;
puti(f());
+ A : [f()]int;
};