;; REPL, SBCL 1.1.7 (defun repl-fun (noprint) (/show0 "entering REPL") (loop (unwind-protect (progn ;; (See comment preceding the definition of SCRUB-CONTROL-STACK.) (scrub-control-stack) (sb!thread::get-foreground) (unless noprint (flush-standard-output-streams) (funcall *repl-prompt-fun* *standard-output*) ;; (Should *REPL-PROMPT-FUN* be responsible for doing its own ;; FORCE-OUTPUT? I can't imagine a valid reason for it not to ;; be done here, so leaving it up to *REPL-PROMPT-FUN* seems ;; odd. But maybe there *is* a valid reason in some ;; circumstances? perhaps some deadlock issue when being driven ;; by another process or something...) (force-output *standard-output*)) (let* ((form (funcall *repl-read-form-fun* *standard-input* *standard-output*)) (results (multiple-value-list (interactive-eval form)))) (unless noprint (dolist (result results) (fresh-line) (prin1 result))))) ;; If we started stepping in the debugger we want to stop now. (disable-stepping))))