[fpc-devel] New feature discussion: for-in loop
Alexander Klenin
klenin at gmail.com
Tue Oct 20 10:27:01 CEST 2009
On Tue, Oct 20, 2009 at 19:22, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> 2009/10/20 Alexander Klenin <klenin at gmail.com>:
>>
>> Well, I suggest you to read at least the link provided in the original post,
>> and maybe also some documention about Delphi/C# enumerators.
>
>
> I just read the docs in the lazarus wiki. The problems/limitations
> still hold true. For-in only goes in ONE direction
Hm, did you read the about reverseEnumerators and various irders of
tree traversals?
> and can't peak
That is true, but this is required in maybe 1% of the cases, or even less.
For these cases, certainly slightly longer while loop is justified.
> filter returned results etc..
Well, there is no such sample currently on the wiki, but it is still
quite possible.
> What good is an enumerator that only ever goes in one direction and
> visits all items. That's not a very flexible design.
Please read again with more attention ;-)
--
Alexander S. Klenin
More information about the fpc-devel
mailing list