interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / tests / fixtures / echo.om

16 lines · 257 bytes Raw Blame History
1note echo: copy stdin to stdout through a 4096-byte pool, until read gives 0
2global buf uchar 4096
3fn main to int
4n = read 0 buf 0 len buf
5while gt n 0
6w = write 1 buf 0 ulong n
7if ne w n
8ret 1
9end
10n = read 0 buf 0 len buf
11end
12if lt n 0
13ret 2
14end
15ret 0
16end