up previous next
1.9.1 Changes in the CoCoA language
CoCoA-5 is largely, but not completely, backward-compatible with CoCoA-4. Some commands/functions have changed name; others have been removed or replaced. Here we give a little guidance to help update your CoCoA-4 programs to CoCoA-5/

The operator Not has been replaced by the function not(...) .

Example
/*C4*/ If Not X IsIn L Then ... EndIf;
/*C5*/ If not(X IsIn L) Then ... EndIf;
Several functions modify one of their arguments (e.g. append , sort ); CoCoA-5 wants these arguments to be identified with the new keyword ref , and will issue a warning if you don't do this (just to make sure you know that L will be modified).

Example
/*C4*/ L := [1,2,3];  Append(L, 4);
/*C5*/ L := [1,2,3];  append(ref L, 4);
Implicit multiplication has gone: either write x*y instead of xy for every product, or use CoCoA-4 mode .

Example
/*C4*/ F := 3xyzt;
/*C5*/ F := 3*x*y*z*t;  OR  F := ***3xyzt***;
Many CoCoA-4 functions would employ the CurrentRing implicitly (e.g. NumIndets() , CoeffRing() ). They now require an explicit argument; you can pass CurrentRing as the argument, but inside a function you must make that system variable visible via the command TopLevel .

Example
/*C4*/ Define LastIndet() Return Last(Indets()); EndDefine;
/*C5*/ Define LastIndet()
         TopLevel CurrentRing;
         Return last(indets(CurrentRing));
       EndDefine;
However, we encourage you to consider modifying your function so that it does not depend on CurrentRing ; e.g. you can find out to which ring a value belongs by calling the function RingOf .

Example
/*C5*/ I := ideal(x,y^2);  NumIndets(RingOf(I));
The function LinKer has been replaced by LinKerBasis , and there is a new function called LinKer which produces a matrix.

More generally, see also the CoCoA-4 "translation table" in the CoCoAManual directory or at
  http://cocoa.dima.unige.it/cocoalib/doc/CoCoATranslationTable.html