diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-06-05 19:57:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-06-05 19:57:02 -0700 |
commit | c6d3a92f68f91ef3fee09e8d2051ae066162482d (patch) | |
tree | f82e1f3c6d718491502b7eef0efab211f1c7e3f7 /lib.c | |
parent | 93a6c70030251b94d3e2fdc7a4c51d69b612c374 (diff) | |
download | txr-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |