(defun eval-from-clients ()
(dolist (cli clients)
(when (si::listen cli)
- (let ((sto *standard-output*))
- (setq *standard-output* cli)
- (setq *break-enable* nil)
- (eval (read cli))
- (setq *break-enable* t)
- (setq *standard-output* sto)))))
+ (secure-block cli (eval (read cli))))))
(defun stop-server ()
(when socket
(t (power (* p 2) n)))))
(power 1 n)))
-(defmacro secured-eval (form &optional output-stream)
+(defmacro secure-block (output-stream &rest forms)
(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))
+ ,(when output-stream
+ `(format ,output-stream
+ (cond ((eq error-name :WRONG-TYPE-ARGUMENT) (string error-name))
+ (t error-format-string))))
(setf (symbol-function 'si::universal-error-handler) ,error-handler)
(return-from secure))
(let (result-eval)
- (setq result-eval (eval ,form))
+ (setq result-eval (progn ,@forms))
(setf (symbol-function 'si::universal-error-handler) ,error-handler)
result-eval))))
(defun run-mobs (option &key args function)
(dolist (mob running-mobs)
(cond (function (funcall function)))
- (apply (symbol-function mob) (cons option args))))
+ (secure-block nil (apply (symbol-function mob) (cons option args)))))
(defun mob-off (mob)
(push mob mobs-to-quit))
(defun refresh-running-mobs ()
(do ((mob (pop mobs-to-add) (pop mobs-to-add))) ((null mob))
(push mob running-mobs)
- (funcall (symbol-function mob) :init))
+ (secure-block nil (funcall (symbol-function mob) :init)))
(setq running-mobs (reverse (set-difference running-mobs mobs-to-quit)))
(setq mobs-to-quit nil))