#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:10

fn println(io: &IO, str: String);

Prints the given string to stdout with a trailing newline.

print root/IO.vi:16

fn print(io: &IO, str: String);

Prints the given string to stdout without a trailing newline.

print_char root/IO.vi:23

fn print_char(io: &IO, char: Char);

Prints the given character to stdout.

print_bytes root/IO.vi:29

fn print_bytes(io: &IO, bytes: List[N32]);

print_byte root/IO.vi:35

fn print_byte(io: &IO, byte: N32);

flush root/IO.vi:42

fn flush(io: &IO);

Flushes any buffered output to stdout.

prompt root/IO.vi:49

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:56

fn read_line(io: &IO) -> Option[String];

Reads a line from stdin.

full_input root/IO.vi:78

fn full_input(io: &IO) -> String;

Reads all of the input from stdin as a string.

read_byte root/IO.vi:91

fn read_byte(io: &IO, default: Char) -> Char;

forever root/IO.vi:106

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!");
}