failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / null
1 NAME
2     null - null value
3
4 SYNOPSIS
5     null([v_1, v_2,...])
6
7 TYPES
8     v_1, v_2,...        any
9     return              null
10
11 DESCRIPTION
12     After evaluating in order any arguments it may have, null(...)
13     returns the null value.  This is a particular value, different from
14     all other types; it is the only value v for which isnull(v) returns
15     TRUE.  The null value tests as FALSE in conditions, and normally
16     delivers no output in print statements, except that when a list or
17     matrix is printed, null elements are printed as "NULL".
18
19     A few builtin functions may return the null value, e.g.
20     printf(...) returns the null value; if L = list(), then both
21     pop(L) and remove(L) return the null value; when successful,
22     file-handling functions like fclose(fs), fflush(fs), fputs(fs, ...)
23     return the null value when successful (when they fail they return an
24     error-value).  User-defined functions where execution ends
25     without a "return" statement or with "return ;" return the null
26     value.
27
28     Missing expressions in argument lists are assigned the null value.
29     For example, after
30                 define f(a,b,c) = ...
31     calling
32                 f(1,2)
33     is as if c == null().  Similarly, f(1,,2) is as if b == null().
34     (Note that this does not occur in initialization lists; missing
35     expressions there indicate no change.)
36
37     The null value may be used as an argument in some operations, e.g.
38     if v == null(), then for any x, x + v returns x.
39
40     When calc is used interactively, a function that returns the null value
41     causes no printed output and does not change the "oldvalue".  Thus,
42     null(config("mode", "frac")) may be used to change the output mode
43     without printing the current mode or changing the stored oldvalue.
44
45 EXAMPLE
46     > L = list(-1,0,1,2);
47     > while (!isnull(x = pop(L)) print x,; print
48     -1 0 1 2
49
50     > printf("%d %d %d\n", 2, , 3);
51     2  3
52
53     > L = list(,1,,2,)
54     > print L
55
56     list (5 elements, 5 nonzero):
57         [[0]] = NULL
58         [[1]] = 1
59         [[2]] = NULL
60         [[3]] = 2
61         [[4]] = NULL
62
63     > a = 27
64     > null(pi = pi(1e-1000))
65     > .
66         27
67
68 LIMITS
69     The number of arguments is not to exceed 100.
70
71 LINK LIBRARY
72     none
73
74 SEE ALSO
75     isnull, test
76