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 / func_value.om

22 lines · 459 bytes Raw Blame History
1note func_value.om: a bool field set from the value of a function call, in new and in put.
2note big(5) is true and big(2) is false: new with true -> 1, put false -> 2, put true -> 4, a=3.
3struct W a uint f bool end
4fn big x uint to bool
5ret gt x 3
6end
7fn main to uint
8w = new W 3 big 5
9r = uint 0
10if eq get w f true
11r = add r 1
12end
13put w f big 2
14if eq get w f false
15r = add r 2
16end
17put w f big 9
18if eq get w f true
19r = add r 4
20end
21ret add r sub get w a 3
22end