[Maxima] Representing the case "no result"
Dieter Kaiser
drdieterkaiser at web.de
Tue Jun 9 12:26:02 CDT 2009
Am Dienstag, den 09.06.2009, 13:01 -0400 schrieb Raymond Toy:
> Actually, I wasn't thinking about NaN and such, but things like
> divergent integrals and other things like that where Dieter was
> proposing returning NoObjects. In many ways, it makes debugging much
> harder.
Because the discussion has become some length, it might be that the
starting point is missed.
defint throws a Maxima error, when a divergent integral is found. My
suggestion was not to throw a Maxima error, because it is not an error
to have a divergent integral. It does not make sense to break and to
have a look in the routine which has detected the divergent integral.
The question was: What should be the return value instead of throwing an
error?
Here is a list of suggestions so far:
1. A symbol 'divergent
2. An empty list
3. An expression like (($NOOBJECT))
4. A tagged expression like (($NOOBJECT) gensym)
We get a next proposal:
5. An element NoObject[i] of an array of NoObjects
Furthermore, I have suggested to have a general convention for
situations like a divergent integral (e.g. for limits, sums,
products, ...).
My first idea was to search a general and user friendly expression which
Maxima does not change or use in further calculations. Therefore the
empty list.
This is what we have:
(%i1) integrate(x,x,0,inf);
defint: integral is divergent.
-- an error. To debug this try debugmode(true);
This is my first suggestion:
(%i1) integrate(x,x,0,inf);
defint: Maxima encountered a divergent integral in the calculation.
[]
I have thought that this looks a bit more user friendly. No Maxima error
and no result. Of cause, the message can be more verbose. We can include
the integral in the message, give information about the method which
detects the divergent integral, .... Therefore the next idea: Do not
print all information available, but store it and allow the user to
inspect the last messages in more detail.
Dieter Kaiser
More information about the Maxima
mailing list