[fpc-devel] New feature discussion: for-in loop

Alexander Klenin klenin at gmail.com
Tue Oct 20 10:15:25 CEST 2009


On Tue, Oct 20, 2009 at 19:03, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> 2009/10/20 Alexander Klenin <klenin at gmail.com>:
>>> As an alternative to the very limited "for-in", I have a better and
>>> more flexible design, using the Iterator design pattern.
>>
>> for-in is just a syntax sugar plus standard interface for the cost common usage
>> of iterators. So they are not mutually exclusive at all.
>
> Well, with for-in you can only loop through a list is a specific order
> and direction. You can't peak forward, you can't move back, you can't
> filter returned content.
>
> So you, for-in is VERY LIMITED in my eyes, and a total waist of time.

Well, I suggest you to read at least the link provided in the original post,
and maybe also some documention about Delphi/C# enumerators.

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list