[fpc-devel] for-in-index loop

Alexander Klenin klenin at gmail.com
Thu Jan 24 20:36:22 CET 2013


On Fri, Jan 25, 2013 at 4:45 AM, Michael Van Canneyt
<michael at freepascal.org> wrote:
> Enumerators are not iterators.
Eh... actually, they are? Why do you think otherwise?

> If you want a full-fledged iterator, you should use classes.
Enumerators *are* classes, except for built-in ones.

> The for syntax is not meant for that.
That's debatable.
There is no for-index support in Java, but there is in most (all?)
other modern languages --
Python, PHP, Ruby, etc.
I suggest that Java is inferior in this regard.

>If you want full fledged iterators, use classes.
Please provide example of your suggesion for the case in the wiki.

--
Alexander S. Klenin



More information about the fpc-devel mailing list