[ 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.

2 2020-11-17 15:39

Useful.

3 2020-11-17 19:03 *

You can also hit control-c twice when you're thown into the debugger, that automatically puts you back at the top level.

4


VIP:

do not edit these