[ prog / sol / mona ]

prog


How to make the MIT Scheme REPL more tolerable

1 2020-11-03 04:15

Put this into ~/.scheme.init:

(unless (nearest-cmdl/batch-mode?)
  (bind-default-condition-handler
    '()
    (lambda (c)
      (display c)
      (newline)
      (restart 1))))

Run this:

(load-option 'format)

(with-output-to-file "rlcommands" (lambda ()
  (let loop ((bindings (environment-bindings system-global-environment)))
    (when (not (null? bindings))
      (format #t "~a\n" (car (car bindings)))
      (loop (cdr bindings))))))

Use the output with rlwrap:

rlwrap -b '(' -f rlcommands -H rlhistory scheme

Enjoy your tab completion and silent error handling.

4


VIP:

do not edit these