focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / push
1 NAME
2     push - push one or more values into the front of a list
3
4 SYNOPSIS
5     push(x, y_0, y_1, ...)
6
7 TYPES
8     x           lvalue whose value is a list
9     y_0, ...    any
10
11     return      null value
12
13 DESCRIPTION
14      If after evaluation of y_0, y_1, ..., x is a list with
15      contents (x_0, x_1, ...), then after push(x, y_0, y_1, ..., y_n-1),
16      x has contents (y_n-1, ..., y_1, y_0, x_0, x_1, ...), i.e. the
17      values of y_0, y_1, ... are inserted in succession at the beginning
18      of the list.
19
20      This function is equivalent to insert(x, 0, y_n-1, ..., y_1, y_0).
21
22 EXAMPLE
23     > A = list(2,"three")
24     > print A
25
26     list (2 elements, 2 nonzero):
27       [[0]] = 2
28       [[1]] = "three"
29
30     > push(A, 4i, 7^2)
31     > print A
32
33     list (4 elements, 4 nonzero):
34       [[0]] = 49
35       [[1]] = 4i
36       [[2]] = 2
37       [[3]] = "three"
38
39     > push (A, pop(A), pop(A))
40     > print A
41
42     list (4 elements, 4 nonzero):
43       [[0]] = 4i
44       [[1]] = 49
45       [[2]] = 2
46       [[3]] = "three"
47
48 LIMITS
49     push() can have at most 100 arguments
50
51 LINK LIBRARY
52     none
53
54 SEE ALSO
55     append, delete, insert, islist, list, pop, remove, rsearch, search, size
56