X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-aclrepl%2Ftoplevel.lisp;h=e80ad9b67277f36c911f11a40190da04fe0c5699;hb=df871446529da0e83d670f35a9566c11d814be32;hp=316c8fb0366aecb6cb120cd6716a7dcc2b5cc785;hpb=8a8a8922802460741d6f8f6c11d71b1f414cf3a7;p=sbcl.git diff --git a/contrib/sb-aclrepl/toplevel.lisp b/contrib/sb-aclrepl/toplevel.lisp index 316c8fb..e80ad9b 100644 --- a/contrib/sb-aclrepl/toplevel.lisp +++ b/contrib/sb-aclrepl/toplevel.lisp @@ -1,7 +1,7 @@ (cl:defpackage :sb-aclrepl (:use "COMMON-LISP" "SB-EXT") (:shadowing-import-from "SB-IMPL" "SCRUB-CONTROL-STACK") - (:shadowing-import-from "SB-INT" "*REPL-PROMPT-FUN*" "*REPL-READ-FORM-FUN*" "*STEP*" "*STEPPING*") + (:shadowing-import-from "SB-INT" "*REPL-PROMPT-FUN*" "*REPL-READ-FORM-FUN*") (:export ;; user-level customization of UI "*PROMPT*" "*EXIT-ON-EOF*" "*MAX-HISTORY*" @@ -25,32 +25,32 @@ "boolean: T if break caused by continuable error") (defun repl (&key - (break-level (1+ *break-level*)) - (noprint *noprint*) - (inspect nil) - (continuable nil)) + (break-level (1+ *break-level*)) + (noprint *noprint*) + (inspect nil) + (continuable nil)) (let ((*noprint* noprint) - (*break-level* break-level) - (*inspect-break* inspect) - (*continuable-break* continuable)) + (*break-level* break-level) + (*inspect-break* inspect) + (*continuable-break* continuable)) (sb-int:/show0 "entering REPL") (loop (multiple-value-bind (reason reason-param) - (catch 'repl-catcher - (loop + (catch 'repl-catcher + (loop (unwind-protect (rep-one) - ;; reset toplevel step-condition handler - (setf *step* nil - *stepping* nil)))) + ;; if we started stepping in the debugger, now is the + ;; time to stop + (sb-impl::disable-stepping)))) (declare (ignore reason-param)) (cond - ((and (eq reason :inspect) - (plusp *break-level*)) - (return-from repl)) - ((and (eq reason :pop) - (plusp *break-level*)) - (return-from repl))))))) + ((and (eq reason :inspect) + (plusp *break-level*)) + (return-from repl)) + ((and (eq reason :pop) + (plusp *break-level*)) + (return-from repl))))))) (defun rep-one () "Read-Eval-Print one form" @@ -66,15 +66,15 @@ ;; by another process or something...) (force-output *standard-output*)) (let* ((form (funcall *repl-read-form-fun* - *standard-input* - *standard-output*)) - (results (multiple-value-list (sb-impl::interactive-eval form)))) + *standard-input* + *standard-output*)) + (results (multiple-value-list (sb-impl::interactive-eval form)))) (unless *noprint* (dolist (result results) - ;; FIXME: Calling fresh-line before a result ensures the result starts - ;; on a newline, but it usually generates an empty line. - ;; One solution would be to have the newline's entered on the - ;; input stream inform the output stream that the column should be - ;; reset to the beginning of the line. - (fresh-line *standard-output*) - (prin1 result *standard-output*))))) + ;; FIXME: Calling fresh-line before a result ensures the result starts + ;; on a newline, but it usually generates an empty line. + ;; One solution would be to have the newline's entered on the + ;; input stream inform the output stream that the column should be + ;; reset to the beginning of the line. + (fresh-line *standard-output*) + (prin1 result *standard-output*)))))