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 / rung4 / tests / t_env.om
| 1 | note envcnt and envread (OMEGESE 10 host words, om4 knows them for omc.om): every entry of the environment is read |
| 2 | note back (a NAME=VALUE with its = sign), whatever the environment holds; then the index envcnt traps 3 (status 103) |
| 3 | global b uchar 131072 |
| 4 | fn main to int |
| 5 | n = envcnt |
| 6 | if lt n 0 |
| 7 | ret 1 |
| 8 | end |
| 9 | i = ulong 0 |
| 10 | while lt i ulong n |
| 11 | k = envread i b 0 131072 |
| 12 | if lt k 1 |
| 13 | ret 2 |
| 14 | end |
| 15 | eq1 = false |
| 16 | j = ulong 0 |
| 17 | while lt j ulong k |
| 18 | if eq get b j 61 |
| 19 | eq1 = true |
| 20 | end |
| 21 | j = add j 1 |
| 22 | end |
| 23 | if not eq1 |
| 24 | ret 3 |
| 25 | end |
| 26 | i = add i 1 |
| 27 | end |
| 28 | k = envread i b 0 1 |
| 29 | ret 4 |
| 30 | end |