//ww:run package main; type thread = struct { pc: size, matched: bool }; fn setpc(ts: *[]thread, i: size) void = { (*ts)[i].pc = 9; }; fn bump(ts: *[]thread, i: size) void = { (*ts)[i].pc += 1; }; fn markm(ts: *[]thread, i: size) void = { (*ts)[i].matched = true; }; export fn main() i32 = { let ts: []thread = []; append(ts, thread { pc = 7, matched = false }); setpc(&ts, 0); if (ts[0].pc != 9) { return 1; }; bump(&ts, 0); if (ts[0].pc != 10) { return 2; }; markm(&ts, 0); if (!ts[0].matched) { return 3; }; return 0; };