On Wed, Mar 1, 2017 at 4:31 PM, Ralf Hemmecke <[email protected]> wrote:
> I don't like this. If you specify that p and q have to be non-zero, then
> checking in code is just a safety check that supports either users that
> do not want to read the specification or you want to add a security
> meassure for cases when sylvesterMatrix is used as a sub-routine and is
> called with zero arguments. That's, of course a bug, but not a bug in
> sylvesterMatrix, but in the calling program.
I think the "correct" way to do this is to write sylvesterMatrix's signature
to sylvesterMatrix:(UP, UP)-> Maybe M (or Union("failed", M)). That way,
people without reading documentation will know it may fail for some arguments,
and caller functions (such as subResultantList) will have to deal with it
or it won't compile. But this (Maybe monad) is not well support right now.
A user may directly call sylvesterMatrix, of course sylvesterMatrix should
check its arguments.
> I'm not a fan of (randomly) checking for conditions of arguments that
> (according to the specification) should never be given. Admittedly your
> test is not time consuming, but is by specification unnecessary.
>
> BTW, why "p=0" instead of "zero?(p)".
>
> Ralf
Yes, "zero?" should be better, but I don't know why:
there are lots of code containing "one?(x)" got replaced by "x=1",
and there are still usage of "one?".
--
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 https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.