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 / om2 / s4 / v-text-empty-loop.om

19 lines · 471 bytes Raw Blame History
1note S4 empty text: a callee that walks its view (for i ulong len s, get s i) reads no byte of `text e ""`.
2note x = 100000000 is live in the register the old lowering read as the count, so the old loop ran off the
3note image (SIGSEGV). Exit 0 when the sum is 0, else 1.
4om2
5text e ""
6fn sum s view uchar * to ulong
7t = ulong 0
8for i ulong len s
9t = add t ulong get s i
10end
11ret t
12end
13fn main to int
14x = ulong 100000000
15if ne sum e 0
16ret 1
17end
18ret int sub x 100000000
19end