restore list

This commit is contained in:
nora 2023-12-16 13:51:18 +01:00
parent f9e07b376b
commit 179c4b3505

View file

@ -1,21 +1,21 @@
//type List[T] = struct { type List[T] = struct {
// ptr: Int, ptr: Int,
// len: Int, len: Int,
// cap: Int, cap: Int,
//}; };
//
//function new(): List[Int] = ( function new(): List[Int] = (
// List { ptr: 0, len: 0, cap: 0 } List { ptr: 0, len: 0, cap: 0 }
//); );
//
//function push(list: List[Int], elem: Int) = ( function push(list: List[Int], elem: Int) = (
// growIfNeeded(list, 1); growIfNeeded(list, 1);
//); );
//
// PRIVATE: // PRIVATE:
//
//function growIfNeeded(list: List[Int], elems: Int) = ( function growIfNeeded(list: List[Int], elems: Int) = (
// if (list.len + elems) < list.cap then ( if (list.len + elems) < list.cap then (
// let newMemory = std.rt.alloc.allocateItem(0_I32, 0_I32); let newMemory = std.rt.alloc.allocateItem(0_I32, 0_I32);
// ); );
//); );