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 / s3s4 / inline-rec-mutual.om

20 lines · 426 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note Contract section 4 line 94: an inline function must not be recursive (error 9). f and g are both
3note inline and call each other. Without inline (inline-rec-mutual-plain.om) it runs and prints 55.
4om2
5fn f n ulong to ulong inline
6if eq n 0
7ret 0
8end
9ret add n g sub n 1
10end
11fn g n ulong to ulong inline
12if eq n 0
13ret 0
14end
15ret add n f sub n 1
16end
17fn main to int
18pu f 10
19ret 0
20end