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 / profile / cases / ok-b2-nested.om
| 1 | note Positive B2 control: guard and call in one nested block, with an inner if/else between them. |
| 2 | fn walk depth ulong to ulong |
| 3 | if lt depth 100 |
| 4 | nd = add depth 1 |
| 5 | if gt nd 64 |
| 6 | ret 0 |
| 7 | end |
| 8 | x = ulong 0 |
| 9 | if eq nd 3 |
| 10 | x = ulong 1 |
| 11 | else |
| 12 | x = ulong 2 |
| 13 | end |
| 14 | r = walk nd |
| 15 | ret add x r |
| 16 | end |
| 17 | ret 0 |
| 18 | end |
| 19 | fn main to int |
| 20 | d = walk 0 |
| 21 | ret int d |
| 22 | end |