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

Graeme Geldenhuys graemeg.lists at gmail.com
Sun Oct 25 10:05:57 CET 2009


On 25/10/2009, Alexander Klenin <klenin at gmail.com> wrote:
>
> 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


As I explained in my previous reply to Paul - I did not expect for-in
to support everything I use with Iterators. I simply wanted to find
out if the for-in implementation is going to clash with my idea of
implementing GetIterator() in RTL's container classes. So far I don't
see any problems, and I can't see why we can't implement both. There
are use-cases for both.  I see for-in as a "lite" version of Iterator,
but I still have a need for a more "full" implementation as well -
supporting a larger method interface.


> It does not. I dislike the "Enumerator" term too, but this is how it
>  is called in Delphi :-(

Java uses both, that is why I asked. But yes, I kind-of expected them
to be the same thing, but just wanted to make sure.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list