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 / qualification / om2 / sec / s5s7 / v6-edit.om

24 lines · 611 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note contract 6 lines 172-176: `part a 3 4` of a local array passed to an unsized edit writes elements
3note 3..6 only; inside, `view part e 1 2` turns a part of an edit into a view (line 176), whose len is 2.
4note stdout: 2, the row ...XXXX..., 4 (exp/v6-edit.out, python3).
5om2
6fn plen v view uchar * to ulong
7ret len v
8end
9fn fill e edit uchar * c uchar to ulong
10for i ulong len e
11put e i c
12end
13putd plen view part e 1 2
14ret len e
15end
16fn main to int
17a = new uchar 10 46
18m = fill part a 3 4 88
19nl = new uchar 1 10
20w = write 1 a 0 10
21w = write 1 nl 0 1
22putd m
23ret 0
24end