omega-mcp
aien-dev/omega-mcp
Brought by drakestapleton
omega-mcp / data / examples / pools.om
| 1 | note a run-time pool (omc only): global NAME T * has length 0 at start and r = enlarge NAME n grows it (r is 0, |
| 2 | note or -22 / the host's negative errno when refused, NAME unchanged); get, put and len see the current length |
| 3 | global P ulong * |
| 4 | fn main to int |
| 5 | if ne len P 0 |
| 6 | ret 1 |
| 7 | end |
| 8 | r = enlarge P ulong 3 |
| 9 | if ne r 0 |
| 10 | ret 2 |
| 11 | end |
| 12 | put P 2 39 |
| 13 | r = enlarge P ulong 2 |
| 14 | put P 0 len P |
| 15 | ret int add get P 0 get P 2 |
| 16 | end |