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