Temporarily suppress all error messages
Astrea Drifter <[email protected]> Mon, 18 May 2026 20:52:32 -0600
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CADZFxcmx0i7yYNvQcaa23u5h0j01wOJ3xi_dfbD1WPYNuw2iLw@mail.gmail.com> |
Greetings all, I gathered in the manual that any questions can be posted here, even very simple ones. Here is my best explanation of my use case: I have a syntax which (among other features) prints an empty list when an error is detected. This can be a numerical error such as division by zero, or a syntax error such as misplaced parentheses. I am interested in creating a command which will additionally suppress all error messages, so that nothing but the empty list will be printed in the case of an error. My rationale is that, in the vast majority of instances in which an error occurs, I already know what went wrong: either I misplaced a parenthesis somewhere, or I forgot one of the arguments to a function, or some such mistake. I can find and fix these mistakes easily enough, and in such cases, it seems pointless and annoying to have my screen cluttered up by error messages telling me what I already know while I fix my work. I am of course aware that errors can occur for reasons that I wouldn't have expected, and so I'm looking for a command that can also be reversed when necessary, to turn error messages back on. The "errormsg" command is capable of doing all the things I want, in certain situations: (%i86) errormsg:true$ (%i87) "1/0"~; expt: undefined: 0 to a negative exponent. (%o87) [] (%i88) errormsg:false$ (%i89) "1/0"~; (%o89) [] Unfortunately, this doesn't work all the time: (%i90) errormsg:true$ (%i91) "(1/1"~; incorrect syntax: Missing ) (1/1$ ^ (%o91) [] (%i92) errormsg:false$ (%i93) "(1/1"~; incorrect syntax: Missing ) (1/1$ ^ (%o93) [] While searching for solutions, I found a thread where the following commands were recommended to turn off error and warning messages respectively, and these seemed well suited for the use case of that thread's op: :lisp (defun merror(&rest foo) nil) :lisp (defun mtell (&rest foo) nil) Unfortunately, while I have some experience with Maxima, I know nothing at all about Lisp. The commands do not work as given (which is not to my surprise) and I have no idea how to make them do any of the things I would want them to be doing. Can someone relate to me the sort of syntax that would be needed to make these commands do anything of the sort? Alternatively, does anyone have a command that might work better for this purpose? Thanks in advance for any help, Astrea _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss