]> git.jsancho.org Git - gacela.git/commitdiff
(no commit message)
authorjsancho <devnull@localhost>
Mon, 9 Nov 2009 19:13:14 +0000 (19:13 +0000)
committerjsancho <devnull@localhost>
Mon, 9 Nov 2009 19:13:14 +0000 (19:13 +0000)
gacela_misc.lisp

index a3991d5924d9fdd666b5c4a6d2514f60f7be371a..16e8ab83833ab701d59ddf85ddeda2cc88a6ff72 100755 (executable)
                        (t (power (* p 2) n)))))
          (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))
+
 ;Geometry
 (defun dotp (dot)
   (match-pattern dot '(0 0)))