summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-05 19:57:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-05 19:57:02 -0700
commitc6d3a92f68f91ef3fee09e8d2051ae066162482d (patch)
treef82e1f3c6d718491502b7eef0efab211f1c7e3f7 /lib.c
parent93a6c70030251b94d3e2fdc7a4c51d69b612c374 (diff)
downloadtxr-c6d3a92f68f91ef3fee09e8d2051ae066162482d.tar.gz
txr-c6d3a92f68f91ef3fee09e8d2051ae066162482d.tar.bz2
txr-c6d3a92f68f91ef3fee09e8d2051ae066162482d.zip
transpose: ensure variadic args are a list.
* lib.c (transpose): Don't simply copy the input, but convert it to a list with tolist. The transposev function relies on mapcarv, and that function now doesn't simply pull out the trailing object from the args. It processes the args as args, and a non-list causes problems there, such as args_count reporting the wrong value.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index c59c45a9..5b5a9367 100644
--- a/lib.c
+++ b/lib.c
@@ -7557,10 +7557,10 @@ val transposev(struct args *list)
return mapcarv(func, list);
}
-val transpose(val list)
+val transpose(val seq)
{
- args_decl_list(args, ARGS_MIN, copy(list));
- return make_like(transposev(args), list);
+ args_decl_list(args, ARGS_MIN, tolist(seq));
+ return make_like(transposev(args), seq);
}
static val do_chain(val fun1_list, struct args *args)