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/seed/omc/tests/struct-bool/param_edit.om # 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 / seed / omc / tests / struct-bool / param_edit.om` 30 lines ยท 551 bytes Raw Blame History 1 note param_edit.om: a bool field written and read through an edit parameter, and a bool value 2 note passed as a parameter. set true, flip, set false; the caller sees every change. Result 7. 3 struct W a uint f bool end 4 fn setf p edit W v bool to void 5 put p f v 6 end 7 fn flip p edit W to void 8 if eq get p f true 9 put p f false 10 else 11 put p f true 12 end 13 end 14 fn main to uint 15 w = new W 3 false 16 r = uint 0 17 setf w true 18 if eq get w f true 19 r = add r 1 20 end 21 flip w 22 if eq get w f false 23 r = add r 2 24 end 25 flip w 26 if eq get w f true 27 r = add r 4 28 end 29 ret add r sub get w a 3 30 end