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 | 4d07a024953528b5a44cfa0e5ffd6622428d5a4f (patch) | |
tree | f82e1f3c6d718491502b7eef0efab211f1c7e3f7 | |
parent | fecc6288083401b8a8aecd1e42b67f1395d00024 (diff) | |
download | txr-4d07a024953528b5a44cfa0e5ffd6622428d5a4f.tar.gz txr-4d07a024953528b5a44cfa0e5ffd6622428d5a4f.tar.bz2 txr-4d07a024953528b5a44cfa0e5ffd6622428d5a4f.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.
-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) |