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 | 5d0eb90d21bf830fdfc91337b4b3975a64a406f7 (patch) | |
tree | 7b6cff7004afd79c29447eda7741acef52d9ec85 /lib.c | |
parent | e91d406a7ff82b8dfd57b3d84065597b640328db (diff) | |
download | txr-5d0eb90d21bf830fdfc91337b4b3975a64a406f7.tar.gz txr-5d0eb90d21bf830fdfc91337b4b3975a64a406f7.tar.bz2 txr-5d0eb90d21bf830fdfc91337b4b3975a64a406f7.zip |
copy-alist: no mapcar.
* lib.c (copy_alist): Rewrite using list_collect iteration.
endp is used for detecting improper list.
Diffstat (limited to 'lib.c')
-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) |