Top
Back: D.2.2.8 kmemory
Forward: D.2.2.10 number_e
FastBack: D. SINGULAR libraries
FastForward: E. Release Notes
Up: D.2.2 general_lib
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

D.2.2.9 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
→ // ** `rtest` is already global
→ // ** `i` is already global
→ // ** `str` is already global
→ // ** `j` is already global
listvar();
→ // j                    [0]  int 3
→ // str                  [0]  string hi
→ // rtest                [0]  *ring
→ //      i                    [0]  ideal, 3 generator(s)
→ // LIB                  [0]  string standard.lib,general..., 74 char(s)
killall("ring");            // kills all rings
→ // ** killing the basering for level 0
listvar();
→ // j                    [0]  int 3
→ // str                  [0]  string hi
→ // LIB                  [0]  string standard.lib,general..., 74 char(s)
killall("not", "int");      // kills all variables except int's (and procs)
listvar();
→ // j                    [0]  int 3
→ // LIB                  [0]  string standard.lib,general..., 74 char(s)
killall();                  // kills all vars except loaded procs
listvar();
→ // j                    [0]  int 3
→ // LIB                  [0]  string standard.lib,general..., 74 char(s)

Top Back: D.2.2.8 kmemory Forward: D.2.2.10 number_e FastBack: D. SINGULAR libraries FastForward: E. Release Notes Up: D.2.2 general_lib Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.