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