From c6d3a92f68f91ef3fee09e8d2051ae066162482d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 5 Jun 2020 19:57:02 -0700 Subject: 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. --- lib.c | 6 +++--- 1 file 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) -- cgit v1.2.3