summaryrefslogtreecommitdiffstats
path: root/lib.c
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 /lib.c
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 'lib.c')
-rw-r--r--lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index a06dfa7e..62d43b67 100644
--- a/lib.c
+++ b/lib.c
@@ -2139,14 +2139,14 @@ val numneqv(val list)
return t;
}
-val max2(val anum, val bnum)
+val max2(val a, val b)
{
- return if3(ge(anum, bnum), anum, bnum);
+ return if3(less(a, b), b, a);
}
-val min2(val anum, val bnum)
+val min2(val a, val b)
{
- return if3(le(anum, bnum), anum, bnum);
+ return if3(less(a, b), a, b);
}
val maxv(val first, val rest)