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 / tests / compiler / progs / sixparams.osc

16 lines · 526 bytes Raw Blame History
1// entry: six_main
2// a callee with 6 mixed parameters: own, &, &mut and scalars.
3fn mix6(o: own [u8; 4], s: &[u8; 4], m: &mut [u8; 4], a: u8, b: i64, c: bool) -> i64 {
4 m[0] = o[1] + s[2] + a;
5 let mut r: i64 = (m[0] as i64) + b;
6 if c { r = r - (s[3] as i64); }
7 return r;
8}
9
10fn six_main(a: u8, b: i32, c: bool) -> i64 {
11 let o: own [u8; 4] = alloc(a);
12 let s: own [u8; 4] = alloc(3);
13 let m: own [u8; 4] = alloc(0);
14 let r: i64 = mix6(o, &s, &mut m, a, b as i64, c);
15 return r + (m[0] as i64);
16}