diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-22 17:02:14 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-22 17:02:14 -0500 |
commit | 1184d39f79a341bfa6c1642dc1ae246113186155 (patch) | |
tree | 1080b1c50c69a98c00911464e7bea0c7ecb1ab4f /std | |
parent | c169e55a4bf4e278b712176ae7a9787f3db8d610 (diff) |
new std/io
Diffstat (limited to 'std')
-rw-r--r-- | std/io.toc | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -1,14 +1,10 @@ pkg "io"; -#export puti ::= fn(x: int) { - #C("printf(\"%ld\\n\", (long)x)"); -}; - -#export putf ::= fn(x: float) { - #C("printf(\"%f\\n\", (double)x)"); -}; +c_putchar :: fn(i32) = #foreign "putchar", "libc.so.6"; #export puts ::= fn(x: []char) { - #C("fwrite(x.data, 1, x.n, stdout)"); - #C("printf(\"\\n\")"); + each c := x { + c_putchar(c as i32); + }; + c_putchar('\n' as i32); };
\ No newline at end of file |