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 / omc / tests / struct-bool / local_value.om

24 lines · 452 bytes Raw Blame History
1note local_value.om: bool values held in locals (a comparison, a not, a read back from the field)
2note go into new and put. t = lt x 3 with x = 2 (true), u = not t (false), v = get w f. Result 1 + 2 + 4.
3struct W a uint f bool end
4fn main to uint
5x = uint 2
6t = lt x 3
7u = not t
8w = new W 1 t
9r = uint 0
10if eq get w f true
11r = add r 1
12end
13put w f u
14v = get w f
15if eq v false
16r = add r 2
17end
18put w f t
19v = get w f
20if eq v true
21r = add r 4
22end
23ret r
24end