Top
Back: 4.7.2 list expressions
Forward: 4.7.4 list related functions
FastBack: 4. Data types
FastForward: 5. Functions and system variables
Up: 4.7 list
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

4.7.3 list operations

+

concatenation

delete

deletes one element from list, returns new list

insert

inserts or appends a new element to list, returns a new list

list_expression [ int_expression ]

is a list entry; the index 1 gives the first element.


Example:

 
  list l1 = 1,"hello",list(-1,1);
  list l2 = list(1,2,3);
  l1 + l2;          // one new list
→ [1]:
→    1
→ [2]:
→    hello
→ [3]:
→    [1]:
→       -1
→    [2]:
→       1
→ [4]:
→    1
→ [5]:
→    2
→ [6]:
→    3
  list l3 =_;
  l1,l2;            // two lists
→ [1]:
→    1
→ [2]:
→    hello
→ [3]:
→    [1]:
→       -1
→    [2]:
→       1
→ [1]:
→    1
→ [2]:
→    2
→ [3]:
→    3
  l2[2];
→ 2

Top Back: 4.7.2 list expressions Forward: 4.7.4 list related functions FastBack: 4. Data types FastForward: 5. Functions and system variables Up: 4.7 list 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.