summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-18 22:54:47 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-18 22:54:47 -0700
commit34a8e91898d551d036742fd6fb45c57b8e95ad52 (patch)
tree472850b44473d47e221d12e75f2c1e8d34de712c /txr.1
parentd8ef238e540a00b77d7c66645b266922a5ecd6fa (diff)
downloadtxr-34a8e91898d551d036742fd6fb45c57b8e95ad52.tar.gz
txr-34a8e91898d551d036742fd6fb45c57b8e95ad52.tar.bz2
txr-34a8e91898d551d036742fd6fb45c57b8e95ad52.zip
New function: flatcar.
* eval.c (eval_init): Register flatcar intrinsic. * lib.c (flatcar): New function. * lib.h (flatcar): Declared. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.134
1 files changed, 34 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index d4ba9353..a7f3a643 100644
--- a/txr.1
+++ b/txr.1
@@ -14762,6 +14762,40 @@ structure is itself lazy.
(flatten '(((()) ()))) -> nil
.cble
+.coNP Function @ flatcar
+.synb
+.mets (flatcar << tree )
+.syne
+.desc
+The
+.code flatcar
+function produces a list of all the atoms contained in the
+tree structure
+.metn tree ,
+in the order in which they appear, when the structure is traversed
+left to right.
+
+This list includes those
+.code nil
+atoms which appear in
+.code car
+fields.
+
+The list excludes
+.code nil
+atoms which appear in
+.code cdr
+fields.
+
+.TP* Examples:
+.cblk
+ (flatcar '(1 2 () (3 4))) -> (1 2 nil 3 4)
+
+ (flatcar '(a (b . c) d (e) (((f)) . g) (nil . z) nil . h))
+
+ --> (a b c d e f g nil z nil h)
+.cble
+
.coNP Function @ tree-find
.synb
.mets (tree-find < obj < tree << test-function )