STk procedure - repl-display-prompt manual page

## repl-display-prompt, repl-display-result

Display a prompt/result in interactive mode

### SYNOPSIS

(repl-display-prompt module)
(repl-display-result value)

### DESCRIPTION

Repl-display-prompt is called by the interactive toplevel loop before reading a sexpr. This procedure is called with one parameter: the selected module in the toplevel loop.

A simple form of this procedure could be:

    (define (repl-display-prompt module)
      (let ((p (current-error-port)))
        (format p "~A> " (module-name module))
        (flush p)))

Repl-display-result is called by the interactive toplevel loop after the evaluation of a sexpr. This procedure is called with the result of this evaluation as parameter.

A simple form, mimicking the MIT Scheme way of presenting results, could be:

    (define (repl-display-result value)
      (format #t "\\n;Value: ~S\\n\\n" value))

Back to the STk main page