Top
Back: if
Forward: quit
FastBack: Functions
FastForward: System variables
Up: Control structures
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: Index
About: About this document

5.2.8 keepring

Syntax:
keepring name ;
Purpose:
moves the specified ring to the next (upper) level. This command can only be used inside of procedures and it should be the last command before the return statement. There it provides the possibility to keep a ring which is local to the procedure (and its objects) accessible after the procedure ended without making the ring global.
Example:
 
proc P1
{
  ring r=0,x,dp;
  keepring r;
}
proc P2
{
  "inside P2: " + nameof(basering);
  P1();
  "inside P2, after call of P1: " + nameof(basering);
}
ring r1= 0,y,dp;
P2();
==> inside P2: r1
==> inside P2, after call of P1: r
"at top level: " + nameof(basering);
==> at top level: r1
See ring.

Top Back: if Forward: quit FastBack: Functions FastForward: System variables Up: Control structures Top: Singular 2-0-4 Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 2-0-4, May 2003, generated by texi2html.