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-direct.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 calls itself. |
| 3 | note Without inline (inline-rec-direct-plain.om) program-mode recursion is allowed (OMEGESE 9.2) and |
| 4 | note prints 55. |
| 5 | om2 |
| 6 | fn f n ulong to ulong inline |
| 7 | if eq n 0 |
| 8 | ret 0 |
| 9 | end |
| 10 | ret add n f sub n 1 |
| 11 | end |
| 12 | fn main to int |
| 13 | pu f 10 |
| 14 | ret 0 |
| 15 | end |