Top
Back: kmemory
Forward: number_e
FastBack:
FastForward:
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.3.10 killall

Procedure from library general.lib (see general_lib).

Usage:
killall(); (no parameter)
killall("type_name");
killall("not", "type_name");

Return:
killall(); kills all user-defined variables except loaded procedures, no return value.
- killall("type_name"); kills all user-defined variables, of type "type_name"
- killall("not", "type_name"); kills all user-defined variables, except those of type "type_name" and except loaded procedures
- killall("not", "name_1", "name_2", ...); kills all user-defined variables, except those of name "name_i" and except loaded procedures

Note:
killall should never be used inside a procedure

Example:
 
LIB "general.lib";
ring rtest; ideal i=x,y,z; string str="hi"; int j = 3;
export rtest,i,str,j;       //this makes the local variables global
listvar();
==> // j                              [0]  int 3
==> // str                            [0]  string hi
==> // rtest                          [0]  *ring
==> //      i                              [0]  ideal, 3 generator(s)
killall("ring");            // kills all rings
==> // ** killing the basering for level 0
listvar();
==> // j                              [0]  int 3
==> // str                            [0]  string hi
killall("not", "int");      // kills all variables except int's (and procs)
==> // ** cannot kill `Singmathic`
listvar();
==> // j                              [0]  int 3
==> // str                            [0]  string hi
killall();                  // kills all vars except loaded procs
listvar();
==> // j                              [0]  int 3


Top Back: kmemory Forward: number_e FastBack: FastForward: Up: general_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.3.1, 2022, generated by texi2html.