summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-11 06:40:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-11 06:40:24 -0800
commit008fccfa96b61189c0056ff5e3b708be1aa02f45 (patch)
tree16f9cbb9921d6ef18cea8705e2f9a61ef342325f /txr.1
parent82020af157ad104be3a62b57053d2420d17785f9 (diff)
downloadtxr-008fccfa96b61189c0056ff5e3b708be1aa02f45.tar.gz
txr-008fccfa96b61189c0056ff5e3b708be1aa02f45.tar.bz2
txr-008fccfa96b61189c0056ff5e3b708be1aa02f45.zip
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.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.127
1 files changed, 27 insertions, 0 deletions
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 *)