summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc27
1 files changed, 13 insertions, 14 deletions
diff --git a/test.toc b/test.toc
index 2bd8e0f..347eb5a 100644
--- a/test.toc
+++ b/test.toc
@@ -45,22 +45,21 @@ putf @= fn(x: float) {
// };
g @= fn() int {
- foo : [10]int; // = new(int, 10);
+ foo : = new(int, 10);
total := 0;
- each foo { total = total + 1; }
-// each _, i := foo {
- // foo[i] = i;
- // };
- // total := 0;
- // each x := foo {
- // total = total + x;
- // }
- // total
-
- each i := 1..10 {
- total = total + i;
- total
+ // each foo { total = total + 1; }
+ each x, i := &foo {
+ *x = i;
+ };
+ each x, i := foo {
+ total = total + x * i;
}
+ total
+
+ // each i := 1..10 {
+ // total = total + i;
+ // total
+ // }
// total := 0;
// each i, j := 1..10 {
// total = total + i * j;