Home Online Manual
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.9.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,5,7);
  l1 + l2;             // a new list
==> [1]:
==>    1
==> [2]:
==>    hello
==> [3]:
==>    [1]:
==>       -1
==>    [2]:
==>       1
==> [4]:
==>    1
==> [5]:
==>    5
==> [6]:
==>    7
  l2 = delete(l2, 2);  // delete 2nd entry
  l2;
==> [1]:
==>    1
==> [2]:
==>    7