From d5bddfc36f8bc2ca1a3d8831c447e31e892dfbcb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 19 Jun 2024 19:30:35 -0700 Subject: doc: iter-begin copies iterators. * txr.1: Revise text which claims that when iter-begin is invoked on an existing iterator, the returned iterator may share state it. We recently fixed that with the cloning. --- txr.1 | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/txr.1 b/txr.1 index fde65f54..8562eabb 100644 --- a/txr.1 +++ b/txr.1 @@ -39621,17 +39621,6 @@ itself as the iterator. Likewise if .meta seq 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 @@ -39647,6 +39636,18 @@ or methods. A struct object supporting none of these methods is deemed not iterable. +Otherwise, if +.meta seq +is an iterator object of +.code seq-iter +type, such as one produced by +.codn iter-begin , +then an iterator similar to that iterator is returned, as if produced +by applying the +.code copy-iter +function to +.metn seq . + In all other cases, if .meta seq is iterable, an object of type -- cgit v1.2.3