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

Michael Van Canneyt michael at freepascal.org
Tue Oct 20 11:18:49 CEST 2009



On Tue, 20 Oct 2009, Alexander Klenin wrote:

> On Tue, Oct 20, 2009 at 19:34, Michael Van Canneyt
> <michael at freepascal.org> wrote:
>> You don't know this with an iterator since you depend on the implementation
>> of the iterator. The loop could loop forever then...
>
> Just as it can when using iterators explicitly. No difference here.

The difference is that the language guarantees that the for loop will run
OK. It makes no such guarantees with a while or repeat loop.

Michael.



More information about the fpc-devel mailing list