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 / sites / found-arrpart-3.om

61 lines · 1215 bytes Raw Blame History
1note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in arrpart (code 7)
2note S4 part (spec 6): parts of a local (an edit), of an unsized edit, of an unsized view and of a
3note text; `view part` of an edit; an empty part at the end; a part passed to an inline function; o and k
4note from calls. The callee sees len = k and elements o .. o+k-1. Exit 0 when every check holds.
5om2
6text msg "0123456789"
7fn plen v view uchar * to ulong
8ret len v
9end
10fn first v view uchar * to ulong
11ret ulong get v 0
12end
13fn fill e edit uchar * c uchar to ulong
14for i ulong len e
15put e i c
16end
17ret add plen edit part e 1 1 len e
18end
19fn ifirst v view uchar * to ulong inline
20ret ulong get v 0
21end
22fn sub2 v view uchar * o ulong to ulong
23ret first part v o 2
24end
25fn two to ulong
26ret 2
27end
28fn main to int
29a = new uchar 10 46
30if ne fill part a 3 4 88 5
31ret 1
32end
33if ne get a 2 46
34ret 2
35end
36if ne get a 6 88
37ret 3
38end
39if ne get a 7 46
40ret 4
41end
42if ne first part msg 7 3 55
43ret 5
44end
45if ne sub2 msg 4 52
46ret 6
47end
48if ne plen part a 10 0 0
49ret 7
50end
51if ne ifirst part msg 9 1 57
52ret 8
53end
54if ne plen part a two add two 1 3
55ret 9
56end
57if ne ifirst view part a 6 two 88
58ret 10
59end
60ret 0
61end