puti @= fn(x: int) { #C("printf(\"%ld\\n\", (long)x); "); }; putf @= fn(x: float) { #C("printf(\"%f\\n\", (double)x); "); }; // f @= fn() { // each i := 1..4 { // puti(i); // } // each i := 4,-1..1 { // puti(i); // } // each i := 1.0..4.0 { // putf(i); // } // each i := 7.0,-1..4.0 { // putf(i); // } // // each i := 0.0,-3.0.. { putf(i); } // foo := new(int, 3); // each _, i := foo { // foo[i] = i; // }; // each x := foo { // puti(x); // } // each _ := foo { // #C("puts(\"Hello!\")"); // } // bar : [3]int; // each _, i := bar { // bar[i] = i*i*i; // }; // each x := bar { // puti(x); // } // }; g @= fn() int { foo : = new(int, 10); total := 0; // 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; // } // total }; main @= fn() { puti(g()); X @= g(); puti(X); each i, j := 1..10 { puti(i + j); } };