Suppressing error message "-- an error. To debug this try: debugmode(true); "



2012/12/1 Robert Dodier <robert.dodier at gmail.com>

> On 2012-12-01, Stefano Ferri <ferriste at gmail.com> wrote:
>
> > which only prints a new line. It works perfectly but maybe it is a ugly
> > solution... How can I avoid to rewrite all the function and redefine only
> > the "format t (....." line?
> > Even if ugly, could it be a correct solution?
>
> Yes, it's correct. No,there isn't (given the function definitions as
> they are) to omit only the one line.
>


Ok, now I have another question: if error() is called at some point in a
.mac file, it prints a stack with informations of the sequence of functions
which lead to the error, for example:

Error (here there is my error message)
#0: foo(args)(file.mac line 1236)

but also #1, #2 etc. can be present, depending on the nesting of the
functions. How to suppress the printing of these informations starting with
#? Which part of Maxima source code controls this behavior?

>
>
> >>  * define your own function which uses Maxima's throw/catch mechanism.
> >>    E.g.: myerror (msg) := (print (msg), throw ('oops));
> >>    throw/catch is a nonlocal flow of control mechanism, maybe that's
> >>    what you want.
> >
> > I'll look at this way too, but I would lose the information contained in
> > errormsg(), which sometimes is useful.
>
> Well, you can throw any expression. So it might be something like
> oops("some message", parameter1=1234, parameter2=2345) where the
> parameters give some context about the error.
>


I'll look forward at this solution, I've written a little example but I
didn't manage the code to stop the execution with the catch/throw
mechanism...


Thanks
Stefano




> best
>
> Robert Dodier
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>