>
> ** [feature-requests:#12] Better Error Messages When Working on SPAD Code**
>
> I would like better error messages when using both interpreter and compiler.
> Also hide underlying Lisp nature of the program from users using interpreter
> and writing SPAD.
>
> The error messages in the interpreter don't seem very helpful, for instance
> if I just type something in at random:
>
> (1) -> a|b
> >> Error detected within library code:
> (1 . failed) cannot be coerced to mode (NonNegativeInteger)
>
> * Why is this an error with the library code rather than user input?
> * What has this got to do with a NonNegativeInteger?
What you wrote means: "a such that b is 0". For the interpreter
this is syntactially OK and types look plausible ('a' is a symbol
and 'b' is a polyniomial) so it passes the data to the library.
More precisely, it tries to initialze
SimpleAlgebraicExtension(Fraction(Polynomial(Integer)), _
UnivariatePolynomial('a, Fraction(Polynomial(Integer))), b)
SimpleAlgebraicExtension assumes that polynomial has positive
degree and tries to subtract 1. But in your case degree is 0
so subraction fails and produce the message above.
So, the error is detected only when running library code. In
principle library should contain tests for possible errors and
print nicer error messages. OTOH in this case wrong user
input is caught wher trying to interpret result as
NonNegativeInteger. We could make the generic message a bit
nicer someting like:
Wrong union branch detected: "failed" of type "failed" is
not of type NonNegativeInteger
or maybe
"failed" of mode Union(NonNegativeInteger, "failed") cannot
be coerced to mode NonNegativeInteger
which is closer to original message. Another thing is adding
more checks to the library. But that is larger job...
> It would be useful to have documentation with a list of all the possible
> errors and what might be done about them. I started to keep a list of the
> errors that I was getting, but soon gave up, see page here:
> http://www.euclideanspace.com/maths/standards/program/spad/debug/
'System error:' comes from underlying Lisp and normaly means a bug,
either in FriCAS or the code FriCAS user wrote. User can cause
it by improper use of 'pretend' or by calling internal low
level routines which to gain speed use reduced error checking.
Unless you were plying low level tricks this should be reported.
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.