From 008fccfa96b61189c0056ff5e3b708be1aa02f45 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 11 Nov 2015 06:40:24 -0800 Subject: Adding revappend and nreconc. * eval.c (eval_init): Register revappend and nreconc intrinsics. * lib.c (list_collect_nreconc): New function. (revlist): New static function. (list_collect_revappend): New function. (revappend, nreconc): New functions. * lib.h (revappend, nreconc): Declared. (list_collect_nreconc, list_collect_revappend): Declared. * txr.1: Documented revappend and nreconc. --- txr.1 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index aa22c111..f56cccb2 100644 --- a/txr.1 +++ b/txr.1 @@ -14447,6 +14447,33 @@ traverse the last argument.) (append '(a . b) 3 '(1 2 3)) -> **error** .cble +.coNP Functions @ revappend and @ nreconc +.synb +.mets (revappend < list1 << list2 ) +.mets (nreconc < list1 << list2 ) +.syne +.desc +The +.code revappend +function returns a list consisting of +.code list2 +appended to a reversed copy of +.metn list1 . +The returned object shares structure +with +.metn list2 , +which is unmodified. + +The +.code nreconc +function behaves similarly, except +that the the returned object may share +structure with not only +.meta list2 +but also +.metn list1 , +which is modified. + .coNP Function @ list .synb .mets (list << value *) -- cgit v1.2.3