X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Ftoplevel.lisp;h=87a47526f89c2e2072cacf7f378066c3caa65ce8;hb=f33fdd489e9012e5064d35ca7edc7d4bc3c4a0c2;hp=95cd0ec62d7feb5858680edf5a3f15f2dde7efcb;hpb=121a6e2e935db79d09b5e687bd4380fbaa17ed93;p=sbcl.git diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 95cd0ec..87a4752 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -291,13 +291,13 @@ command-line.") (defvar +++ nil #!+sb-doc "the previous value of ++") (defvar - nil #!+sb-doc "the form currently being evaluated") -(defun interactive-eval (form) +(defun interactive-eval (form &key (eval #'eval)) #!+sb-doc "Evaluate FORM, returning whatever it returns and adjusting ***, **, *, +++, ++, +, ///, //, /, and -." (setf - form) (unwind-protect - (let ((results (multiple-value-list (eval form)))) + (let ((results (multiple-value-list (funcall eval form)))) (setf /// // // / / results @@ -398,14 +398,12 @@ command-line.") t)) (defun process-script (script) - (let ((pathname (native-pathname script)) - (ok nil)) - (unwind-protect - (with-open-file (f pathname :element-type :default) - (maybe-skip-shebang-line f) - (load f :verbose nil :print nil) - (setf ok t)) - (quit :unix-status (if ok 0 1))))) + (let ((pathname (native-pathname script))) + (handling-end-of-the-world + (with-open-file (f pathname :element-type :default) + (maybe-skip-shebang-line f) + (load f :verbose nil :print nil) + (quit))))) ;; Errors while processing the command line cause the system to QUIT, ;; instead of trying to go into the Lisp debugger, because trying to