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 / effects / cases / files.om
| 1 | note files: create, stat and remove one file in the current directory. |
| 2 | text nm "effects.tmp" |
| 3 | fn main to int |
| 4 | fd = int fopen nm 0 len nm 578 384 |
| 5 | if lt fd 0 |
| 6 | ret 1 |
| 7 | end |
| 8 | w = write fd nm 0 len nm |
| 9 | st = new uchar 128 0 |
| 10 | r = fstat fd st 0 128 |
| 11 | c = fclose fd |
| 12 | u = unlink nm 0 len nm |
| 13 | if or ne r 0 ne u 0 |
| 14 | ret 2 |
| 15 | end |
| 16 | ret 0 |
| 17 | end |