Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tests/compiler/slices/zz_misc.osc # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tests / compiler / slices / zz_misc.osc` 17 lines ยท 595 bytes Raw Blame History 1 // Slice value as another slice's index, empty slices, recursion passing a slice down. 2 // slice-run: pick bytes:0305 cells:4 -> 5 cells=0,0,0,5 3 // slice-run: pick bytes:0905 cells:4 -> trap=BOUNDS 4 // slice-run: pick bytes:09 cells:4 -> trap=BOUNDS 5 // slice-run: pick bytes: cells:NULL -> trap=BOUNDS 6 // slice-run: sumc cells:3=1,2,3 -> 6 7 // slice-run: sumc cells:0 -> 0 8 fn pick(b: bytes, c: cells) -> u64 { 9 c[b[0]] = b[1]; 10 return c[3]; 11 } 12 fn sumc(c: cells) -> u64 { 13 let mut s: u64 = 0; 14 let mut i: u64 = 0; 15 while i < c.len bound 64 { s = s + c[i]; i = i + 1; } 16 return s; 17 }