Add in address_of_ensure_variable_lower.krak that makes sure & can always take a reference, even of a constant, etc, and start the cleanup of c_generator that this allows

This commit is contained in:
Nathan Braswell
2017-10-22 21:41:58 -04:00
parent 73faf50053
commit e70d31a51c
6 changed files with 103 additions and 121 deletions

View File

@@ -83,6 +83,10 @@ obj stack<T> (Object, Serializable) {
}
fun reverse_vector(): vector::vector<T>
return data.reverse()
fun index_from_top_satisfying(func_raw: run(T):bool): int {
var temp_lambda = fun(i: T):bool { return func_raw(i); }
return index_from_top_satisfying(temp_lambda);
}
fun index_from_top_satisfying(func: fun(T):bool): int {
for (var i = 0; i < data.size; i++;)
if (func(from_top(i)))