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/progs/df_both.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 / progs / df_both.osc` 15 lines ยท 522 bytes Raw Blame History 1 // entry: f 2 // OSC-3 item 3 (drop flags): an owner moved on both paths is definitely 3 // moved after the `if`: no drop flag, no release (code as in OSC-2). 4 fn take(x: own [u16; 3]) -> u16 { return x[0] + x[2]; } 5 6 fn f(k: u16) -> u16 { 7 let a: own [u16; 3] = alloc(k & 255); 8 let b: own [u16; 3] = alloc(2); 9 let mut r: u16 = 0; 10 if k > 100 { r = take(a); } else { let m: own [u16; 3] = a; r = m[1] + 1; } 11 return r + take(b); 12 } 13 // expect-run: f 200 -> 404 14 // expect-run: f 7 -> 12 15 // expect-run: f 300 -> 92