summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.133
1 files changed, 30 insertions, 3 deletions
diff --git a/txr.1 b/txr.1
index 503b7771..23b55eac 100644
--- a/txr.1
+++ b/txr.1
@@ -6900,19 +6900,20 @@ A bignum integer: arbitrary precision integer that is heap-allocated.
.PP
There are additional kinds of objects, such as streams.
-.SS Functions null and not
+.SS Functions null, not, false
.TP
Syntax:
(null <value>)
(not <value>)
+ (false <value>)
.TP
Description:
-The null and not functions are synonyms. They tests whether <value> is the
-object nil. They return t if this is the case, nil otherwise.
+The null, not and false functions are synonyms. They tests whether <value> is
+the object nil. They return t if this is the case, nil otherwise.
.TP
Examples:
@@ -6920,6 +6921,7 @@ Examples:
(null '()) -> t
(null nil) -> t
(null ()) -> t
+ (false t) -> nil
(if (null x) (format t "x is nil!"))
@@ -6927,6 +6929,31 @@ Examples:
(if (not (memq 'a list))
(format t "list ~s does not contain the symbol a\en")))
+.SS Function true
+
+.TP
+Syntax:
+
+ (true <value>)
+
+.TP
+Description:
+
+The true function is the complement of the null, not and false functions.
+It return t if the <value> is any object other than nil. If <value> is
+nil, it returns nil.
+
+Note: programs should avoid explicitly testing values with true.
+For instance (if x ...) should be favored over (if (true x) ...)
+
+.TP
+Example:
+
+ ;; Compute indices where the list '(1 nil 2 nil 3) has true values:
+ ;; "Where is (1 nil 2 nil 3) true?"
+
+ [where '(1 nil 2 nil 3) true] -> (1 3)
+
.SS Functions eq, eql and equal
.TP