up previous next
CurrentRing

the current ring

Syntax
CurrentRing

Description
This is a top-level SYSTEM VARIABLE containing the current ring.

NOTE: in CoCoA-4 it used to be a function (namely CurrentRing() ), now it is a top-level variable which needs to be imported in functions... but beware: this is to be considered BAD STYLE ;-)

Example
/**/  use R ::= QQ[x,y];
/**/  use S ::= ZZ/(3)[t];
/**/  CurrentRing;
RingDistrMPolyClean(FFp(3), 1)

/**/  use R;
/**/  CurrentRing;
RingDistrMPolyClean(QQ, 2)

/**/  Define MyIndets1()
/**/    TopLevel CurrentRing; -- importing a top-level (global) variable
/**/    Return indets(CurrentRing);
/**/  EndDefine;

/**/  Define MyIndets2(val)
/**/    Return indets(RingOf(val));  -- cleaner: depends only on the argument
/**/  EndDefine;

/**/ MyIndets1();
[x, y]

/**/ MyIndets2(ideal(x));
[x, y]

See Also