
linsert - insertion into a list

Calling sequence:
linsert(list, expr, n)

Parameter:
list   --  list
expr   --  expression
n      --  integer

Summary:

linsert inserts elements into the listlist before the n-th element of list
and returns the new list as the result. If expr is a list, then all elements of
expr are inserted, otherwise expr itself is inserted.  If n < 1, then expr is
inserted in front of the first element of list. If n > nops(list) then expr
is appended to list.

>>  linsert([a,b,c], x+y, 2);

     [a, x + y, b, c]

>>  linsert([a,b,c],[x,y,z],0);

     [x, y, z, a, b, c]

>>  linsert([a,b,c],d,1000);

      [a, b, c, d]

See also:  append

