[fpc-devel] for-in-index loop

vrt277 vrt277 at gmail.com
Fri Jan 25 14:03:16 CET 2013


On 01/25/2013 07:07 PM, Michael Van Canneyt wrote:
> The use case presented is SO MARGINAL that it does NOT justify another 
> language feature. 
What will you do if you have to iterate through keys of hash table ? c++ 
stl library have own solution for this: iterator returns structure 
called "pair" which have 2 fields. First field contains key and second 
field contains value. (It's similar  to situation when you have to 
return 2 values from function. You can define new type called pair and 
return 2 values. But I doubt someone likes to do it). Now lets compare 
c++stl-like solution and for-in-index loop solution:
c++stl-like solution:
container ----> iterator ----> pair (structure stores key-value) -----> 
pair.key or pair.value
for-in-loop key solution
container ----> iterator ----> key or value

> If he wants to help, Alexander  Klenin had better put his students to useful tasks.
Actually you(and all other developers of fpc) should do it. I will describe.
I found only one page which describes open issues: 
http://wiki.freepascal.org/Open_tasks. And you can *not* go to this page 
from main page of http://www.freepascal.org/. Looks not very 
contributors-friendly.

Should be you dislike Perl programming language. But visit 
http://www.perl.org/ and first thing that you will see "That's why we 
love Perl 5". They love Perl and they show it. If Freepascal is open 
project then show it. Describe to everyone how he can support fpc.

Best regards,
Vasiliy Kevroletin




More information about the fpc-devel mailing list