From: jsancho Date: Tue, 10 Nov 2009 00:51:26 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=978e906d4f01dcc3dd386e4b0d2fa32564ecc83c;p=gacela.git --- diff --git a/gacela_misc.lisp b/gacela_misc.lisp index 16e8ab8..d9f38da 100755 --- a/gacela_misc.lisp +++ b/gacela_misc.lisp @@ -69,13 +69,16 @@ (power 1 n))) (defmacro secured-eval (form &optional output-stream) - `(let ((error-handler #'si::universal-error-handler) - (result-eval)) - (defun si::universal-error-handler (error-name correctable function-name continue-format-string error-format-string &rest args) - ,(when output-stream `(format ,output-stream error-format-string))) - (setq result-eval (eval ,form)) - (setf (symbol-function 'si::universal-error-handler) error-handler) - result-eval)) + (let ((error-handler #'si::universal-error-handler)) + `(block secure + (defun si::universal-error-handler (error-name correctable function-name continue-format-string error-format-string &rest args) + ,(when output-stream `(format ,output-stream error-format-string)) + (setf (symbol-function 'si::universal-error-handler) ,error-handler) + (return-from secure)) + (let (result-eval) + (setq result-eval (eval ,form)) + (setf (symbol-function 'si::universal-error-handler) ,error-handler) + result-eval)))) ;Geometry (defun dotp (dot)