summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc14
1 files changed, 7 insertions, 7 deletions
diff --git a/test.toc b/test.toc
index 53efe0d..c12a1f7 100644
--- a/test.toc
+++ b/test.toc
@@ -1,19 +1,19 @@
#include "std/io.toc";
-s ::= struct(x::..) {
-};
-
-f ::= fn(x : ..) int {
+g ::= fn(x : ..) int {
total := 0;
- for _, i := x {
- total += i * (x[0] as int);
+ for e, i := x {
+ total += i * (e as int);
}
total
};
+f ::= fn(x : ..) int {
+ g(x)
+};
main ::= fn() {
- puti(f(5));
+ puti(g(5));
puti(f(5,6));