From: Michel T. <ta...@lp...> - 2025-04-07 09:23:45
|
In fact to arrange that your scripts get killed with an exit error as soon as there is an error in them you can do the following, for sbcl. - maxima errors: they are generated in function merror in merror.lisp You can simply redefine (defun merror (sstring &rest l) (sb-ext:exit :code4)) and as soon as a maxima error is produced the script will die with exit code 4. -lisp errors. They are generated through various functions attached to *debugger-hook*. You can get the killing effect by: (%i1) :lisp(defun my-debug (cond get-out)(declare (ignore get-out)) (print cond)(sb-ext:exit :code 4)) MY-DEBUG (%i1) :lisp(setq *debugger-hook* 'my-debug) MY-DEBUG (%i1) :lisp(/ 1 0) #<DIVISION-BY-ZERO {10028D1203}> michel$ echo $? 4 So all you have to do is to write a file "name".lisp with the defun merror, the defun my-debug, the setq and load this file in each of your scripts, you should be OK. Le 06/04/2025 à 16:15, Michel Talon a écrit : > It would be necessary to intercept the condition before the restart is > active and issue the (sb-ext:exit :code 4). Also what about maxima > errors which are not lisp errors? -- Michel Talon |