1. Module (chicken repl)
    1. repl
    2. repl-prompt
    3. quit
    4. reset
    5. reset-handler

Module (chicken repl)

This module provides procedures you can use to create your own Read-Eval-Print Loop (REPL).


[procedure] (repl [EVALUATOR])

Start a new read-eval-print loop. Sets the reset-handler so that any invocation of reset restarts the read-eval-print loop. Also changes the current exception-handler to display a message, write any arguments to the value of (current-error-port) and reset.

If EVALUATOR is given, it should be a procedure of one argument that is used in place of eval to evaluate each entered expression.

You can use quit to terminate the current read-eval-print loop.


[parameter] (repl-prompt)

A procedure that should evaluate to a string that will be printed before reading interactive input from the user in a read-eval-print loop. Defaults to (lambda () "#;N> ").


[procedure] (quit [RESULT])

In the interpreter quit exits the currently active read-eval-print loop. In compiled code, it is equivalent to calling exit. See also the repl procedure.


[procedure] (reset)

Reset program (Invokes reset-handler).


[parameter] (reset-handler)

A procedure of zero arguments that is called via reset. The default behavior in compiled code is to invoke the value of (exit-handler). The default behavior in the interpreter is to abort the current computation and to restart the read-eval-print loop.

Previous: Module (chicken read-syntax)

Next: Module (chicken sort)