mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
61 lines
1.1 KiB
Plaintext
61 lines
1.1 KiB
Plaintext
NAME
|
|
append - append one or more values to end of list
|
|
|
|
SYNOPSIS
|
|
append(x, y_0, y_1, ...)
|
|
|
|
TYPES
|
|
x lvalue whose value is a list
|
|
y_0, ... any
|
|
|
|
return null value
|
|
|
|
DESCRIPTION
|
|
If after evaluation of y_0, y_1, ..., x is a list with contents
|
|
(x_0, x_1, ...), then after append(x, y_0, y_1, ...), x has
|
|
contents (x_0, x_1, ..., y_0, y_1, ...).
|
|
|
|
If after evaluation of y_0, y_1, ..., x has size n,
|
|
append(x, y_0, y_1, ...) is equivalent to insert(x, n, y_0, y_1, ...).
|
|
|
|
EXAMPLE
|
|
> x = list(2,3,4)
|
|
> append(x, 5, 6)
|
|
> print x
|
|
|
|
list (5 elements, 5 nonzero):
|
|
[[0]] = 2
|
|
[[1]] = 3
|
|
[[2]] = 4
|
|
[[3]] = 5
|
|
[[4]] = 6
|
|
|
|
> append(x, pop(x), pop(x))
|
|
> print x
|
|
|
|
list (5 elements, 5 nonzero):
|
|
[[0]] = 4
|
|
[[1]] = 5
|
|
[[2]] = 6
|
|
[[3]] = 2
|
|
[[4]] = 3
|
|
|
|
> append(x, (remove(x), 7))
|
|
> print x
|
|
|
|
list (5 elements, 5 nonzero):
|
|
[[0]] = 4
|
|
[[1]] = 5
|
|
[[2]] = 6
|
|
[[3]] = 2
|
|
[[4]] = 7
|
|
|
|
LIMITS
|
|
append() can have at most 100 arguments
|
|
|
|
LIBRARY
|
|
none
|
|
|
|
SEE ALSO
|
|
delete, insert, islist, list, pop, push, remove, rsearch, search, size
|