summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 07704dd2..1d4f09d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2012-08-29 Kaz Kylheku <kaz@kylheku.com>
+ * lib.c (multi_sort_less): Fixing semantics of return value. Individual
+ sorted lists are returned, rather than a list of zipped tuples.
+
+2012-08-29 Kaz Kylheku <kaz@kylheku.com>
+
* lib.c (multi_sort_less): Change the semantics so that when the
list of the functions is empty, the left item is considered less
than the right, thereby preserving the order.
diff --git a/lib.c b/lib.c
index 69de8369..8fa575e1 100644
--- a/lib.c
+++ b/lib.c
@@ -4017,12 +4017,14 @@ static val multi_sort_less(val funcs, val llist, val rlist)
val multi_sort(val funcs, val lists)
{
- val lol = mapcarv(func_n0v(identity), lists);
+ val tuples = mapcarv(func_n0v(identity), lists);
if (functionp(funcs))
funcs = cons(funcs, nil);
- return sort_list(lol, func_f2(funcs, multi_sort_less), identity_f);
+ tuples = sort_list(tuples, func_f2(funcs, multi_sort_less), identity_f);
+
+ return mapcarv(func_n0v(identity), tuples);
}
val find(val item, val list, val testfun, val keyfun)