focus expression text field at startup -> version 1.2
[LeanCalc.git] / help / modify
1 NAME
2     modify - modify a list or matrix by changing the values of its elements
3
4 SYNOPSIS
5     modify(x, y)
6
7 TYPES
8     x           lvalue with list or matrix value
9     y           string
10
11     return      null value
12
13 DESCRIPTION
14     For modify(x, y), y is to be the name fname of a user-defined function.
15     The value of each element of x is replaced by the value of the
16     function at that value, i.e.  if fname = "f", the value of x[[i]]
17     is changed to f(x[[i]]).
18
19     As the name indicates, modify(x) usually changes x values of elements
20     in x.  To obtain a modified copy of x without changing values in x,
21     one may xmod = x; modify(xmod, y) or more simply (xmod = x, y).
22
23 EXAMPLE
24     > define f(x) = x^2
25     > A = list(2,4,6)
26     > modify(A, "f")
27     > print A
28
29     list (3 elements, 3 nonzero):
30           [[0]] = 4
31           [[1]] = 16
32           [[3]] = 36
33
34 LIMITS
35     none
36
37 LINK LIBRARY
38     none
39
40 SEE ALSO
41     makelist
42