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 / runs / p-part.om

26 lines · 562 bytes Raw Blame History
1om2
2note p-part: slices into unsized parameters: a whole local array and parts of it into a view, an edit part
3note written through, len of a slice; then a part one element too long traps 3 (omc arrpart, ΩIR chk.slice)
4fn sum a view uint * to ulong
5s = ulong 0
6for i ulong len a
7s = add s ulong get a i
8end
9ret s
10end
11fn bump a edit uint * v uint to void
12for i ulong len a
13put a i add get a i v
14end
15end
16fn main to int
17b = new uint 8 0
18for i ulong 8
19put b i uint add i 1
20end
21bump part b 4 2 100
22x = sum b
23y = sum part b 2 3
24z = sum part b 6 3
25ret int add x y
26end