From 1c043f68a42c69e8c5f467722125bca2a0ad37ae Mon Sep 17 00:00:00 2001 From: Guilherme Affonso Date: Fri, 8 Feb 2019 12:42:34 +0900 Subject: [PATCH 1/2] Allow reseting to previous error stacks --- lisp/l/toplevel.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/l/toplevel.l b/lisp/l/toplevel.l index 18e6c2ed5..a953d4777 100644 --- a/lisp/l/toplevel.l +++ b/lisp/l/toplevel.l @@ -291,8 +291,8 @@ (format *error-output* "~C[0m~%" #x1b) (let ((*replevel* (1+ *replevel*)) (*reptype* "E")) - (catch *replevel* (reploop #'toplevel-prompt))) - (throw *replevel* nil)) + (while (catch *replevel* (reploop #'toplevel-prompt)))) + (throw *replevel* t)) ;;; ;;; default toplevel From da468f8d2c54a234e4a38da41c9b598173f9a391 Mon Sep 17 00:00:00 2001 From: Guilherme Affonso Date: Wed, 27 Feb 2019 12:12:54 +0900 Subject: [PATCH 2/2] Fix variable evaluation on 'evaluate-stream' --- lisp/l/toplevel.l | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lisp/l/toplevel.l b/lisp/l/toplevel.l index a953d4777..9655cfac5 100644 --- a/lisp/l/toplevel.l +++ b/lisp/l/toplevel.l @@ -124,28 +124,30 @@ (let* ((eof (cons nil nil)) (command (read input nil eof)) (arglist) (arg) result) - (cond ((eq command eof) ) + (flet ((normal-eval (comm) + (setq - comm) + (setq result (eval comm)))) + (cond + ((eq command eof) ) ((symbolp command) ;; (if *history* (add-history (input . buffer))) (cond ((fboundp command) (setq arglist nil) (while (not (eq (setq arg (read input nil eof)) eof)) (push arg arglist)) - (setq - (cons command (nreverse arglist))) - (setq result (eval -))) - ((and (boundp command) - (eq (read input nil eof) eof)) - (setq - command) - (setq result (eval command))) + (if (and (null arglist) (boundp command)) + (normal-eval command) ;; eval symbol if bound and w/o args + (normal-eval (cons command (nreverse arglist))))) + ((boundp command) + (normal-eval command)) ((find-package (string command)) (in-package (string command))) - (*try-unix* - (setq - (list 'unix:system (input . buffer))) - (setq result (unix:system (input . buffer)) ) ) - (t (warn "?~%")) )) + ((and *try-unix* + ;; try normal-eval when unix command is not found (errno 127) + (not (equal (normal-eval (list 'unix:system (input . buffer))) #x7f00)))) + (t (normal-eval command)) )) (t ;; (if *history* (add-history (input . buffer))) - (setq - command) - (setq result (eval command)) )) + (normal-eval command) ))) result)) (defun toplevel-prompt (strm)