Skip to content

REPL

resonon with no file opens the REPL, in the project of the working directory. Its flags are in the CLI reference.

The prompt is > . Each line is evaluated when you press Enter, on its own: a statement cannot continue on the next line.

A line that does not end in ; or } gets a ; added, so PLAY runs PLAY;. Only the text before the first // is looked at for this.

Output of print() from a cycle callback, and errors raised there, are printed between prompts.

These words are read by the REPL itself, alone on a line, in capitals:

CommandWhat it does
EXITLeaves the REPL.
RESETDiscards the session and prints Session reset. — as the RESET; statement.
RELOAD nameLoads the native extension name again — as reload_ext("name"). Without a name: Usage: RELOAD <extension_name>.

The transport statements work as they do in a file run and from VSCode.

KeyWhat it does
EnterEvaluates the line
Ctrl+CDiscards the line and shows a new prompt
Ctrl+DLeaves the REPL
↑ / ↓The previous and next lines of this session
Ctrl+RSearches the lines of this session
← / →, Ctrl+A / Ctrl+EMoves in the line, to its start or end

The history is kept only while the REPL runs; nothing is written to disk.