more work on the ast_transformation

This commit is contained in:
Nathan Braswell
2015-12-28 03:34:40 -05:00
parent 22b334a2ae
commit fd6383124c
8 changed files with 106 additions and 54 deletions

View File

@@ -258,5 +258,10 @@ obj vector<T> (Object, Serializable) {
maxIdx = i
return data[maxIdx]
}
fun reduce<U>(func: fun(T,U): U, initial: U): U {
for (var i = 0; i < size; i++;)
initial = func(data[i], initial)
return initial
}
};