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

14 lines · 396 bytes Raw Blame History
1note param_view.om: a bool field read through a view parameter in a helper that returns a number.
2note true counts 2 and false counts 1 for each of two structs, plus the numbers: 2 + 1 + 20 + 30.
3struct W a uint f bool end
4fn weight v view W to uint
5if eq get v f true
6ret add 2 get v a
7end
8ret add 1 get v a
9end
10fn main to uint
11p = new W 20 true
12q = new W 30 false
13ret add weight p weight q
14end