Opened 9 years ago
Closed 9 years ago
#517 closed bug (fixed)
ring command modifies arguments silently
Reported by: | Owned by: | hannes | |
---|---|---|---|
Priority: | minor | Milestone: | Release 4-0-0 |
Component: | singular-kernel | Version: | 3-1-6 |
Keywords: | ring modification user parameters silent evil | Cc: |
Description
1.Following command modifies passed characteristic silently:
ring rng = 8,x,dp; // char modified to 7
Now imagine there is a bug in a library where the parameter for characteristic (8) is not correct. If the authors or users are lucky, the error will be discovered by tests, otherwise this could result in incorrect results
Good programs should behave as much predictable as possible. Proposal:
maxPrime(8); // = 7; // new routine; eventually find a more descriptive name. ring rng = maxPrime(8),x,dp;
2.Following command removes parameter variables silently:
ring rng = (integer,a),x,dp; // creates '(integer),x,dp';
If an error occurs, the user should be informed
Proposal: throw an error
Remarks: All versions affected.
I hope there is no need to argue, why silent argument modification is evil in general
Change History (3)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Owner: | changed from somebody to hannes |
---|
comment:3 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
invalid characteristics results in an warning (and a charcateristic of 32003), other invalid coeff descriptions leads to an ring construction error
in spielwiese
triggers a segfault