core: add IO.errorln and IO.error

This commit is contained in:
hellerve 2018-10-22 17:47:40 -04:00
parent e84018fe6c
commit 6e33a8c2f9
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,10 @@
(register println (Fn [(Ref String)] ()))
(doc print "prints a string ref to stdout, does not append a newline.")
(register print (Fn [(Ref String)] ()))
(doc errorln "prints a string ref to stderr, appends a newline.")
(register errorln (Fn [(Ref String)] ()))
(doc error "prints a string ref to stderr, does not append a newline.")
(register print (Fn [(Ref String)] ()))
(doc get-line "gets a line from stdin.")
(register get-line (Fn [] String))
(doc get-char "gets a character from stdin.")

View File

@ -6,6 +6,9 @@
void IO_println(String *s) { puts(*s); }
void IO_print(String *s) { printf("%s", *s); }
void IO_errorln(String *s) { fprintf(stderr, "%s\n", *s); }
void IO_error(String *s) { fprintf(stderr, "%s", *s); }
char IO_EOF = (char) EOF;
#ifndef _WIN32