#root
IO root/IO.vi
type IO;
A special primitive type used to interact with the outside world. Values of this type cannot be explicitly constructed; instead, an IO handle is passed in to main at the start of the program.
println root/IO.vi:12
fn println(io: &IO, str: String);
Prints the given string to stdout with a trailing newline.
print root/IO.vi:18
fn print(io: &IO, str: String);
Prints the given string to stdout without a trailing newline.
print_char root/IO.vi:25
fn print_char(io: &IO, char: Char);
Prints the given character to stdout.
print_bytes root/IO.vi:31
fn print_bytes(io: &IO, bytes: List[N32]);
print_byte root/IO.vi:37
fn print_byte(io: &IO, byte: N32);
flush root/IO.vi:44
fn flush(io: &IO);
Flushes any buffered output to stdout.
prompt root/IO.vi:51
fn prompt(io: &IO, msg: String) -> Option[String];
Prints a supplied prompt and then waits for a line of input in response.
read_line root/IO.vi:58
fn read_line(io: &IO) -> Option[String];
Reads a line from stdin.
full_input root/IO.vi:79
fn full_input(io: &IO) -> String;
Reads all of the input from stdin as a string.
read_char root/IO.vi:93
fn read_char(io: &IO) -> Option[Char];
Reads a UTF-8 code point from stdin, returning None() if nothing was read. If an invalid UTF-8 char is encountered, Some(U+FFFD) is returned.
read_byte root/IO.vi:111
fn read_byte(io: &IO) -> Option[Char];
Reads a byte from stdin, returning None() if nothing was read.
forever root/IO.vi:134
fn forever(io: &IO) -> Bool;
Waits for pending IO operations to complete and then returns true. This is useful for creating infinite IO loops.
while io.forever() { io.println("hi!"); }