omega-mcp
aien-dev/omega-mcp
Brought by drakestapleton
omega-mcp / data / examples / calls.om
| 1 | note recursion, a void function, ret with and without a value, grouping parentheses |
| 2 | fn fib n uint to uint |
| 3 | if lt n 2 |
| 4 | ret n |
| 5 | end |
| 6 | ret add (fib sub n 1) (fib sub n 2) |
| 7 | end |
| 8 | fn nothing v uint to void |
| 9 | if gt v 1 |
| 10 | ret |
| 11 | end |
| 12 | end |
| 13 | fn main to int |
| 14 | nothing 3 |
| 15 | x = (fib 10) |
| 16 | ret int x |
| 17 | end |