#include "std/io.toc", io; #include "std/arr.toc", arr; arr_sum ::= fn(t::=, a:arr.Arr(t)) t { total := 0 as t; for x := a.data { total += x; } total }; mk_arr ::= fn(x:int, y:int, z:int) a:arr.Arr(int) { arr.add(&a, x); arr.add(&a, y); arr.add(&a, z); }; main ::= fn() { a := mk_arr(1,2,3); io.puti(arr.len(a)); io.puti(arr_sum(a)); };