summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib.c5
-rw-r--r--txr.111
2 files changed, 16 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 628ed06e..6175497f 100644
--- a/lib.c
+++ b/lib.c
@@ -987,6 +987,11 @@ void seq_iter_init_with_info(val self, seq_iter_t *it,
}
}
}
+ if (it->inf.obj->co.cls == seq_iter_cls)
+ {
+ *it = *coerce(struct seq_iter *, it->inf.obj->co.handle);
+ break;
+ }
if (it->inf.obj->co.cls == tree_iter_cls)
{
it->ui.iter = if3(support_rewind,
diff --git a/txr.1 b/txr.1
index 8b0f53a3..61354add 100644
--- a/txr.1
+++ b/txr.1
@@ -35607,6 +35607,17 @@ is a number.
If
.meta seq
+is an iterator produced by
+.code iter-begin
+then an iterator similar to that iterator is returned, which can continue
+iterating the same sequence. The iterator may be
+.meta seq
+itself or share state with
+.metn seq ,
+and thus may not be relied on to produce an independent, parallel iteration.
+
+If
+.meta seq
is a structure which supports the
.code iter-begin
method, then that method is called and its return value is returned.