Top
Back: list expressions
Forward: list related functions
FastBack: link
FastForward: map
Up: list
Top: Singular Manual
Contents: Table of Contents
Index: 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: list expressions Forward: list related functions FastBack: link FastForward: map Up: list Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-0-1, October 2005, generated by texi2html.