Opened 9 years ago

Closed 9 years ago

#517 closed bug (fixed)

ring command modifies arguments silently

Reported by: kroeker@… 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:


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 kroeker@…

in spielwiese

ring rng = (integer,a),x,dp; 

triggers a segfault

comment:2 Changed 9 years ago by hannes

Owner: changed from somebody to hannes

comment:3 Changed 9 years ago by hannes

Resolution: fixed
Status: newclosed

invalid characteristics results in an warning (and a charcateristic of 32003), other invalid coeff descriptions leads to an ring construction error

Note: See TracTickets for help on using tickets.