up previous next
Guidance for updating CoCoA-4 code
Not E
Var X
Using R Do...EndUsing
|
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(...)
.
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.
Implicit multiplication has gone: either write
x*y
instead of
xy
for every product, or use
CoCoA-4 mode
.
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
. 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
.
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" (where is it???)
/*C4*/ If Not X IsIn L Then ... EndIf;
/*C5*/ If not(X IsIn L) Then ... EndIf;
/*C4*/ F := 3xyzt;
/*C5*/ F := 3*x*y*z*t; OR F := ***3xyzt***;
/*C4*/ Define LastIndet() Return Last(Indets()); EndDefine;
/*C5*/ Define LastIndet() TopLevel CurrentRing; Return last(indets(CurrentRing)); EndDefine;
|