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