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 / pools / g2a.om

39 lines · 705 bytes Raw Blame History
1note gate-pools 2: an index equal to the length (a variable) traps 3 before any store; len + 1 is in range
2note after a grow. With the compare removed the put lands and the next lines print 9.
3global P ulong *
4global ob uchar 24
5fn pnum v ulong to void
6put ob 23 10
7i = ulong 23
8x = v
9go = true
10while go bound 21
11i = sub i 1
12put ob i uchar add rem x 10 48
13x = div x 10
14go = ne x 0
15end
16k = write 1 ob i sub 24 i
17end
18fn plong v long to void
19if lt v 0
20put ob 0 uchar 45
21k = write 1 ob 0 1
22pnum ulong neg v
23else
24pnum ulong v
25end
26end
27fn main to int
28r = enlarge P ulong 10
29put P 9 1
30pnum get P 9
31r = enlarge P ulong 11
32put P 10 5
33pnum get P 10
34i = len P
35put P i 9
36r = enlarge P ulong 12
37pnum get P 11
38ret 0
39end