[fpc-devel] for-in-index loop

Florian Klämpfl florian at freepascal.org
Fri Jan 25 19:30:25 CET 2013


Am 25.01.2013 18:17, schrieb Alexander Klenin:
> On Sat, Jan 26, 2013 at 3:30 AM, Florian Klämpfl <florian at freepascal.org> wrote:
>>> "for-in-index" extension was actually planned by me as a prerequisite
>>> for fcl-stl work.
>>
>> Using indicies is against all principles of iterators.
> I am not sure what princilpes you are talking about,

The theory of iterators.

> but accessing the key of the current element is required quite often
> and provided by iterator implementations in many programming languages

The approach to do so is to use a random access iterator in this case.

> (except for Java, as discussed above).
> I have already provided examples.

Where? Concrete code of a serious language! Not some "oh, yes, this
language has it and that as well"



More information about the fpc-devel mailing list