Top
Back: importfrom
Forward: load
FastBack: Functions
FastForward: System variables
Up: Control structures
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.2.11 keepring

Syntax:
keepring name ;
Warning:
This command is obsolete. Instead the respective identifiers in the ring should be exported and the ring itself should subsequently be returned. The command is only included for backward compatibility and may be removed in future releases.

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: importfrom Forward: load FastBack: Functions FastForward: System variables Up: Control structures Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4-0-3, 2016, generated by texi2html.