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