Iterator::Flex::Manual::PriorArt - Other Iterator Models
version 0.12
Iterators are not new.
These languages provide official iterator facilities, namely classes whose objects retrieve data from a source (similar to this package). There's a range in how they signal exhaustion:
Python, throws an exception StopIteration;
StopIteration
Raku returns a special sentinel value IterationEnd;
IterationEnd
JavaScript returns an object with value and done properties, with done false;
value
done
Ruby (via the Enumerator class) raises the StopIteration exception;
Java throws a NoSuchElementException exception.
NoSuchElementException
C++ arguably has the most complicated model of iterators, as they can insert as well as retrieve. They're also a very different model from other languages, so not comparable.
And Perl... Well, Perl doesn't provide an official iterator, so Perl can signal exhaustion any way it wants. This is great unless you need to use an iterator which doesn't fit your exhaustion model. In any case, see Iterator::Flex::Manual::Alien.
Iterator
Iterator::Simple
Please report any bugs or feature requests to bug-iterator-flex@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Iterator-Flex
Source is available at
https://gitlab.com/djerius/iterator-flex
and may be cloned from
https://gitlab.com/djerius/iterator-flex.git
Please see those modules/websites for more information related to this module.
Iterator::Flex
Iterator::Flex::Manual
Diab Jerius <djerius@cpan.org>
This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
To install Iterator::Flex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Iterator::Flex
CPAN shell
perl -MCPAN -e shell install Iterator::Flex
For more information on module installation, please visit the detailed CPAN module installation guide.