summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.138
1 files changed, 38 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 0409b569..48c9002e 100644
--- a/txr.1
+++ b/txr.1
@@ -40078,6 +40078,44 @@ iterates over the strings
and
.codn "CA" .
+A ranges of any kind may be derived into a
+.IR "skip range" :
+a range which skips elements. A skip range is expressed by a range
+whose
+.code to
+element is a range, whose
+.code to
+element is a positive integer. This can be notated by an expression
+which uses two instances of the
+.code ..
+(dot dot) range notation,
+.codn X..Y..Z ,
+where
+.code X..Y
+must be a valid iterable range on its own, and
+.code Z
+must evaluate to a positive integer.
+For instance
+.code 0..10..2
+denotes a skip range which traverses the values
+.codn 0 ,
+.codn 2 ,
+.codn 4 ,
+.code 6
+and
+.codn 8 .
+This syntax is equivalent to
+.codn "(rcons 0 (rcons 10 2))" .
+The implementation may be understood in terms of cascaded iteration
+objects. In the abstract semantics, when
+.code 0..10..2
+is passed to
+.codn iter-begin ,
+a range iterator is first constructed for the range
+.codn 1..10 .
+Then a skip iterator is constructed, which takes every other element
+from the range iterator. That skip iterator is returned.
+
Search trees are iterable. Iteration entails an in-order visits of the elements
of a tree. A tree iterator created by
.code tree-begin