On Sun, Oct 25, 2009 at 16:49, Paul Ishenin <webpi...@mail.ru> wrote: >> When I use >> iterators, I would like to have the ability to use Current, HasNext, >> HasPrevious, PeakNext, PeakPrevious, Reset, JumpToBack, pass a filter >> to GetIterator... etc. > > I don't argue but how do you think to use HasPrevious, PeakNext, > PeakPrevios, Reset, JumpToBack in the for-in loop? Can you suggest a syntax?
IMHO, Reset/JumpToBack should not be used inside "for..in" loop -- they are analogous to "goto" inside for loop. If "for .. in .. index" extension is implemented, it may be used to call HasPrevious, PeakNext, PeakPrevious and other functions that do not change iterator position. >> Also, I referred to them in my implementation as Iterators - as per >> the Iterator design pattern. How does Enumerator differ from Iterator? It does not. I dislike the "Enumerator" term too, but this is how it is called in Delphi :-( -- Alexander S. Klenin _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel