diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-16 08:16:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-16 08:16:04 -0700 |
commit | 74530a290f08520e06f76da64e160134c6684aee (patch) | |
tree | 7b6cff7004afd79c29447eda7741acef52d9ec85 | |
parent | 1c1be41d260f624d485a259374c88ba275f87783 (diff) | |
download | txr-74530a290f08520e06f76da64e160134c6684aee.tar.gz txr-74530a290f08520e06f76da64e160134c6684aee.tar.bz2 txr-74530a290f08520e06f76da64e160134c6684aee.zip |
copy-alist: no mapcar.
* lib.c (copy_alist): Rewrite using list_collect iteration.
endp is used for detecting improper list.
-rw-r--r-- | lib.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -8177,7 +8177,10 @@ val copy_cons(val cell) val copy_alist(val list) { - return mapcar(func_n1(copy_cons), list); + list_collect_decl (out, ptail); + for (; !endp(list); list = cdr(list)) + ptail = list_collect(ptail, copy_cons(car(list))); + return out; } val mapcar_listout(val fun, val seq) |