diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-28 20:39:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-28 20:39:08 -0700 |
commit | 44aa252186ff37ab871c5b66e62ad26abeb5b385 (patch) | |
tree | 71d887d9d3867e01803792d741a202237b675adc /txr.1 | |
parent | e0cc6c8c21b2442cd5b1f8f51afadca6f3649d70 (diff) | |
download | txr-44aa252186ff37ab871c5b66e62ad26abeb5b385.tar.gz txr-44aa252186ff37ab871c5b66e62ad26abeb5b385.tar.bz2 txr-44aa252186ff37ab871c5b66e62ad26abeb5b385.zip |
doc: document seq-iter type and redocument iter-begin
* txr.1: mention seq-iter in the type hierarchy diagram.
The documentation for iter-begin is revised, and now mentions
that the returned value is of this type in some cases.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 40 |
1 files changed, 30 insertions, 10 deletions
@@ -18525,6 +18525,8 @@ brackets indicate a plurality of types which are not listed by name: | | | +--- tree-iter | | + | +--- seq-iter + | | | +--- cptr | | | +--- dir @@ -34539,14 +34541,12 @@ method. Details are specified in the section .desc The .code iter-begin -function returns an iterator object specialized for the task of traversing the -.meta seq -object. The +function returns an iterator object suitable for traversing the +elements of the sequence denoted by the .meta seq -argument may be any sequence. Additionally, it may be a character, number or -a numeric or character range. +object. -Note: if +If .meta seq is a list-like sequence, then .code iter-begin @@ -34556,6 +34556,28 @@ itself as the iterator. Likewise if .meta seq is a number. +If +.meta seq +is a structure which supports the +.code iter-begin +method, then that method is called and its return value is returned. +A structure which does not support this method is possibly considered +to be a sequence according to the usual criteria, based on whether +it supports the +.codn nullify , +.code length +or +.code car +methods. An struct object supporting none of these methods is deemed +not iterable. + +In all other cases, if +.meta seq +is iterable, an object of type +.code seq-iter +is returned. + +Range objects are iterable. A range is considered to be a numeric or character range if the .code from element is a number or character. The @@ -34576,10 +34598,8 @@ are equivalent to .codn "(iter-begin X)" . If -.meta seq -is a structure which supports the -.code iter-begin -method, then that method is called and its return value is returned. +.code seq +is not an iterable object, an error exception is thrown. .coNP Function @ iter-more .synb |