aboutsummaryrefslogtreecommitdiff
path: root/docs/history/15-o3/code/tests/arrays.zc
diff options
context:
space:
mode:
authorGravatar Moon Flower <moonflower@elhenney.local> 2026-10-14 09:09:21 +0330
committerGravatar Moon Flower <moonflower@elhenney.local> 2026-10-14 09:09:21 +0330
commitdc7f7407e08f54e4a2a3c1d1723b2a7d6959532d (patch)
treed1de9f471a99951c57896f85b5e5523eeb96cee1 /docs/history/15-o3/code/tests/arrays.zc
parenttodo: sync docs, examples and fixtures with the include format, and test acto... (diff)
docs: archive the frozen stage code as one compressed tarball
docs/history kept six stages with a full copy of the project under code/, 3.8 mb of sources duplicated from stage to stage and already superseded. store them as docs/history/code-snapshots.tar.gz, 0.66 mb, and extract one in place to read it. every stage's notes.md stays browsable, and the index says where the code went and how to get it back. the top-level README points at the archive too. its other two links into docs/history, 21-micro and 35-bench, were notes that were never kept and do not resolve; the index now records that.
Diffstat (limited to 'docs/history/15-o3/code/tests/arrays.zc')
-rw-r--r--docs/history/15-o3/code/tests/arrays.zc24
1 files changed, 0 insertions, 24 deletions
diff --git a/docs/history/15-o3/code/tests/arrays.zc b/docs/history/15-o3/code/tests/arrays.zc
deleted file mode 100644
index f8d46d8..0000000
--- a/docs/history/15-o3/code/tests/arrays.zc
+++ /dev/null
@@ -1,24 +0,0 @@
-// growable arrays and fixed ones
-struct point { int x, y; };
-fn main()
-{
- let before = live_objects();
- {
- []int a = new([]int);
- for (int i = 0; i < 100; i++) push(a, i * i);
- putn(len(a)); putc(' '); putn(cap(a)); putc(' '); putn(a[99]); putc(' ');
- putn(pop(a)); putc(' '); putn(len(a)); putc(' ');
- resize(a, 3); putn(len(a)); putc(' '); putn(a[2]); putc(' ');
- fixed []int f = new(fixed []int, 5);
- f[4] = 7; putn(f[4] + len(f)); putc(' ');
- []point ps = new([]point, 2);
- ps[1].y = 9; resize(ps, 10); putn(ps[1].y + len(ps)); putc(' ');
- [8]int st; putn(len(st)); putc(' ');
- []*point owned = new([]*point);
- for (int i = 0; i < 20; i++) { *point p = new(point); p.x = i; push(owned, d*p); }
- putn(owned[19].x); putc(' ');
- putn(live_objects() - before); putc(10);
- }
- putn(live_objects() - before); putc(10);
- return 0;
-}