up previous next
CurrentRing

the current ring

Syntax
CurrentRing

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

NB in CoCoA-4 it used to be a function (i.e. 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(Z)
    Return indets(RingOf(Z));  -- cleaner: depends only on the argument
  EndDefine;

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

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

See Also