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 / ng / front / cases / nom_struct_order.om
| 1 | note Struct put: omc evaluates the index call before the value call. The trace global records the order of |
| 2 | note the two calls in decimal digits (value 1, index 2): index first gives 21. Exit is the trace. |
| 3 | global tr ulong 1 |
| 4 | struct B pad ulong v uint 4 tail ulong end |
| 5 | fn vf to uint |
| 6 | put tr 0 add mul get tr 0 10 1 |
| 7 | ret 7 |
| 8 | end |
| 9 | fn ix to ulong |
| 10 | put tr 0 add mul get tr 0 10 2 |
| 11 | ret 3 |
| 12 | end |
| 13 | fn main to int |
| 14 | b = new B 43690 0 48059 |
| 15 | put b v ix vf |
| 16 | if ne get tr 0 21 |
| 17 | ret 1 |
| 18 | end |
| 19 | if ne get b v 3 7 |
| 20 | ret 2 |
| 21 | end |
| 22 | if ne get b pad 43690 |
| 23 | ret 3 |
| 24 | end |
| 25 | if ne get b tail 48059 |
| 26 | ret 4 |
| 27 | end |
| 28 | ret int get tr 0 |
| 29 | end |