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 / host / tests / structfile.om

31 lines · 497 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note Combined gate: a struct value drives a native file operation in one program.
3struct H x uint y ulong end
4text path "structfile.tmp"
5text body "ok\n"
6fn main to int
7h = new H 7 9
8put h y 42
9fd = int fopen path 0 len path 577 420
10if lt fd 0
11ret 1
12end
13n = write fd body 0 len body
14r = fclose fd
15u = unlink path 0 len path
16if ne n long len body
17ret 2
18end
19if ne r 0
20ret 3
21end
22if ne u 0
23ret 4
24end
25if eq get h x 7
26if eq get h y 42
27ret 0
28end
29end
30ret 5
31end