summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-12 06:21:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-12 06:21:58 -0700
commit722a6ca9a69cdd0a463d48af5380af19fd9779fc (patch)
treea09d91f42a23473111faea7773735bc172c9fb98 /txr.1
parent151e5d5dd38015b1be948477d62bf6e8b908352e (diff)
downloadtxr-722a6ca9a69cdd0a463d48af5380af19fd9779fc.tar.gz
txr-722a6ca9a69cdd0a463d48af5380af19fd9779fc.tar.bz2
txr-722a6ca9a69cdd0a463d48af5380af19fd9779fc.zip
tree: let tree-iter be iterable via generic iteration.
* lib.c (seq_iter_init_with_info): Recognize tree_iter object, and treat using tree iterator function. * tests/010/tree.tl: test case for tree subrange iteration with collect-each. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.121
1 files changed, 21 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index af3fb16a..9f8dc04f 100644
--- a/txr.1
+++ b/txr.1
@@ -34636,6 +34636,14 @@ and
are equivalent to
.codn "(iter-begin X)" .
+Search trees are iterable. Iteration entails an in-order visits of the elements
+of a tree. A tree iterator created by
+.code tree-begin
+is also iterable. It is unspecified whether iteration over a
+.code tree-iter
+object modifies that object to perform the traversal, or whether it uses a copy
+of the iterator.
+
If
.code seq
is not an iterable object, an error exception is thrown.
@@ -51866,6 +51874,19 @@ function to the returned
.code tree-iter
object.
+A
+.code tree-iter
+object is iterable.
+
+.TP* Example:
+
+.verb
+ (collect-each ((el (tree-begin #T(() 1 2 3 4 5)
+ 2 5)))
+ (* 10 el))
+ --> (20 30 40)
+.brev
+
.coNP Function @ tree-reset
.synb
.mets (tree-reset < iter < tree >> [ low-key <> [ high-key ]])