interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / ng / front / cases / nom_struct_order.om

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