NAME
Iterator::Flex::Manual::PriorArt - Other Iterator Models
VERSION
version 0.18
DESCRIPTION
Iterators are not new.
Other Languages
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
;Raku returns a special sentinel value
IterationEnd
;JavaScript returns an object with
value
anddone
properties, withdone
false;Ruby (via the Enumerator class) raises the
StopIteration
exception;Java throws a
NoSuchElementException
exception.
C++
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.
Perl
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.
INTERNALS
SUPPORT
Bugs
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
Source is available at
https://gitlab.com/djerius/iterator-flex
and may be cloned from
https://gitlab.com/djerius/iterator-flex.git
SEE ALSO
Please see those modules/websites for more information related to this module.
AUTHOR
Diab Jerius <djerius@cpan.org>
COPYRIGHT AND LICENSE
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