Here is a read-eval-print-loop which, given an eval, evaluates forms.
writes expressions from
(current-output-port)until an end-of-file is encountered.
repl:quitdynamically bound during
repl: procedures establish, as much as is possible to do
portably, a top level environment supporting macros.
dynamic-wind to catch error conditions
and interrupts. If your implementation supports this you are all set.
Otherwise, if there is some way your implementation can catch error
conditions and interrupts, then have them call
will display its arguments and reenter
slib:error dynamically bound by
To have your top level loop always use macros, add any interrupt catching lines and the following lines to your Scheme init file:
(require 'macro) (require 'repl) (repl:top-level macro:eval)