summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-11-15 16:58:58 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-11-15 16:58:58 -0800
commit290d470eb4c96f12b78667d286d2a11c49d2a619 (patch)
tree8b01b66251b6743bb4f516517d800f96f64dfc31 /txr.1
parent2968f213b667baa8178f90bde8c0d8f757741757 (diff)
downloadtxr-290d470eb4c96f12b78667d286d2a11c49d2a619.tar.gz
txr-290d470eb4c96f12b78667d286d2a11c49d2a619.tar.bz2
txr-290d470eb4c96f12b78667d286d2a11c49d2a619.zip
* lib.c (max2, min2): Use the less comparison function
for generic semantics. * lib.h (max2, min2): Parameter names changed to avoid suggesting that the operands are numbers. * txr.1: Documentation for min and max updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.111
1 files changed, 7 insertions, 4 deletions
diff --git a/txr.1 b/txr.1
index 3b6b99f2..409fe8a3 100644
--- a/txr.1
+++ b/txr.1
@@ -18492,20 +18492,23 @@ and
functions determine and return the highest or lowest
value from among their arguments.
-The arguments must be numbers or characters.
-
If only
.meta first-arg
is given, that value is returned.
+These functions are type generic, since they compare arguments
+using the same semantics as the
+.code less
+function.
+
If two or more arguments are given, then
.code (max a b)
is equivalent to
-.codn (if (>= a b) a b) ,
+.codn (if (less a b) b a) ,
and
.code (min a b)
is equivalent to
-.codn (if (<= a b) a b) .
+.codn (if (less a b) a b) .
If the operands do not
have the same type, then one of them is converted to the type of the other;
however, the original unconverted values are returned. For instance