Iterators

Iterators is work in progress. The only iterator at the moment is ArrayIterator that implements LineReader interface.

Basically, most iterables may have multiple iterators. Mind algorithms with nested loops iterating over same array or list.

However, some iterables may support single iterator only. These are files and most kinds of streams that can be read only sequentially, without prior knowledge of size.

Such iterators can be considered as singletons. Moreover, iterables that allow singleton iterators only, can provide iterator interfaces for self.

There can be multiple versions of iterators for the same iterable. Back to files, LineReader is not the only possible iterator. There also can be ByteReader and CharReader and file iterable may provide all of them.

The private data for Struct type includes itercount field. This is an optimization for LP64 where this field is a padding anyway. Otherwise a mixin would be required for iterables.