summaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-01-22 17:02:14 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-01-22 17:02:14 -0500
commit1184d39f79a341bfa6c1642dc1ae246113186155 (patch)
tree1080b1c50c69a98c00911464e7bea0c7ecb1ab4f /std
parentc169e55a4bf4e278b712176ae7a9787f3db8d610 (diff)
new std/io
Diffstat (limited to 'std')
-rw-r--r--std/io.toc14
1 files changed, 5 insertions, 9 deletions
diff --git a/std/io.toc b/std/io.toc
index 68e9744..ea45ce9 100644
--- a/std/io.toc
+++ b/std/io.toc
@@ -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