Input/output on the Io class: write/display (also bare), read/read-char, the to-string captures, and the REPL hooks.
ns
iode-registered except write/display (kept bare via the keep-list); the other six are Io-only. Reader-context/hot callers fetch-and-cache.
Io(Io write v)Write a value in machine-readable form (strings quoted, etc.). Also available bare as the fundamental output verb.
Parameters:
ANY — Value to writeReturns: ANY — nil
(Io display v)Display a value in human-readable form (strings unquoted). Also available bare as the fundamental output verb.
Parameters:
ANY — Value to displayReturns: ANY — nil
(Io read)Read and parse one expression from stdin.
The read primitive answers the EOF sentinel, %token-eof, at end of input, so that a () in the input is a value; this method answers () there for callers that loop until nil.
Returns: ANY — The parsed expression, or () at end of input
(Io read-char)Read one character from stdin.
Returns: ANY — The character, or () at end of input
(Io write-to-str v)Capture write output as a string (write form: strings quoted).
Parameters:
ANY — Value to serializeReturns: STRING — The machine-readable rendering of V
(Io display-to-str v)Capture display output as a string (display form: strings unquoted).
Parameters:
ANY — Value to serializeReturns: STRING — The human-readable rendering of V
(Io error-line)The source line number where the most recent error was raised. Frozen at raise time, so it is accurate read from inside a guard handler; between errors it retains the last one (boot itself catches some, so it is rarely 0).
Returns: INT — Line number
(Io error-file)The source file path where the most recent error was raised, or “” when it arose from stdin/REPL input rather than an included file. Frozen at raise time (see error-line).
Returns: STRING — File path
(Io repl-read)Read one expression for the REPL, applying its read conventions.
Returns: ANY — The parsed expression