io Module

ask

string1 string2

Prints string1 (prompt), reads a line from STDIN and places it on top of the stack as a string.

choose

((string1 quot1)+) string2 a*

Prints string2, then prints all string1 included in the quotation prepended with a number, and waits from valid input from the user.

If the user enters a number that matches one of the choices, then the corresponding quotation quot1 is executed, otherwise the choice menu is displayed again until a valid choice is made.

column-print

quot int a

Prints all elements of quot to STDOUT, in int columns.

confirm

string bool

Prints string (prompt) appending " [yes/no]: ", reads a line from STDIN and:

  • if it matches /^y(es)$/i, puts true on the stack.
  • if it matches /^no?$/i, puts false on the stack.
  • Otherwise, it prints Invalid answer. Please enter 'yes' or 'no': and waits for a new answer.

debug

a a

Prints a and a new line to STDOUT, if logging level is set to debug or lower.

error

a a

Prints a and a new line to STDERR, if logging level is set to error or lower.

fappend

string1 string2

Appends string1 to the end of file string2.

fatal

a a

Prints a and a new line to STDERR, and exists the program with error code 100.

fread

string string

Reads the file string and puts its contents on the top of the stack as a string.

fwrite

string1 string2

Writes string1 to the file string2, erasing all its contents first.

gets

string

Reads a line from STDIN and places it on top of the stack as a string.

info

a a

Prints a and a new line to STDOUT, if logging level is set to info or lower.

newline

Prints a new line to STDOUT.

notice

a a

Prints a and a new line to STDOUT, if logging level is set to notice (default) or lower.

password

string

Reads a line from STDIN displaying * for each typed character, and places it on top of the stack as a string.

print

a a

Prints a to STDOUT.

print!

a

Prints a to STDOUT and removes a from the stack.

puts

a a

Prints a and a new line to STDOUT.

puts!

a

Prints a and a new line to STDOUT, removing a from the stack.

warning

a a

Prints a and a new line to STDERR, if logging level is set to warning or lower.