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 / put_flip.om
| 1 | note put_flip.om: put changes a bool field both ways. Each correct read adds a distinct bit: 1 2 4. |
| 2 | struct W a uint f bool end |
| 3 | fn main to uint |
| 4 | w = new W 9 false |
| 5 | r = uint 0 |
| 6 | if eq get w f false |
| 7 | r = add r 1 |
| 8 | end |
| 9 | put w f true |
| 10 | if eq get w f true |
| 11 | r = add r 2 |
| 12 | end |
| 13 | put w f false |
| 14 | if eq get w f false |
| 15 | r = add r 4 |
| 16 | end |
| 17 | ret add r get w a |
| 18 | end |