[fpc-devel] for-in-index loop

Alexander Klenin klenin at gmail.com
Fri Jan 25 01:11:16 CET 2013


On Fri, Jan 25, 2013 at 10:38 AM, Graeme Geldenhuys
<graeme at geldenhuys.co.uk> wrote:
> On 01/24/13 23:26, Alexander Klenin wrote:
>>>>> If you want full fledged iterators, use classes.
>>>>
>>>> Please provide example of your suggestion for the case in the wiki.
>>>
>>> I don't need to provide *anything*.
>>
>> Of course you do not, this is why I said "please" :)
>> However, it is impossible to have a meaningful discussion without such
>> an example,
>> so could you please indulge me?
>
> Do you want examples of Iterator classes? If so, I have a such
> implementations I have used for years, and can iterate just about any
> collection object without issue.

Not quite. I am aware of various iterator implementations, including yours.
What I wanted is an example of implementation Michael suggested,
because he said that his variant is better then mine, so a wanted to
look at it to compare.

Do I understand correctly that you are speaking about this article:
http://opensoft.homeip.net/articles/iterator_pattern.pdf ?
As far as I understand, since iterators described in the article do
not have the concept of a current item,
they also do not have concept of an index, and hence are not relevant
in the context of this discussion.

--
Alexander S. Klenin



More information about the fpc-devel mailing list