summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc26
1 files changed, 13 insertions, 13 deletions
diff --git a/test.toc b/test.toc
index 61436ac..c8e20be 100644
--- a/test.toc
+++ b/test.toc
@@ -9,23 +9,23 @@
Arr @= fn (t @ Type) Type {
struct {
- data : []t;
- len, cap : u64;
+ data : t;
+ // len, cap : u64;
}
};
// todo: test that t @ type doesn't cause problems
-arr_add @= fn(t @ Type, a : &Arr(t), x : t) {
- if a.len >= a.cap {
- a.cap = a.cap * 2 + 2;
- new_data := new(t, a.cap);
- each i := 0..a.len {
- new_data[i] = a.data[i];
- }
- a.data = new_data;
- }
- a.data[a.len] = x;
- a.len += 1;
+arr_add @= fn(t @ Type, a : &Arr(t)) {
+ // if a.len >= a.cap {
+ // a.cap = a.cap * 2 + 2;
+ // new_data := new(t, a.cap);
+ // each i := 0..a.len {
+ // new_data[i] = a.data[i];
+ // }
+ // a.data = new_data;
+ // }
+ // a.data[a.len] = x;
+ // a.len += 1;
};