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
omega-mv / seed / omc / tests / struct-bool / array_bool.om
| 1 | note A bool array field uses the admitted struct-field grammar. |
| 2 | note Its true/false/true elements contribute 1 + 0 + 4 = 5. |
| 3 | struct Q v bool 3 end |
| 4 | fn main to uint |
| 5 | q = new Q true |
| 6 | put q v 1 false |
| 7 | r = uint 0 |
| 8 | if eq get q v 0 true |
| 9 | r = add r 1 |
| 10 | end |
| 11 | if eq get q v 1 true |
| 12 | r = add r 2 |
| 13 | end |
| 14 | if eq get q v 2 true |
| 15 | r = add r 4 |
| 16 | end |
| 17 | ret r |
| 18 | end |