[fpc-devel] for-in-index loop
Alexander Klenin
klenin at gmail.com
Fri Jan 25 21:18:19 CET 2013
On Sat, Jan 26, 2013 at 6:59 AM, Sven Barth <pascaldragon at googlemail.com> wrote:
>> What is "concrete code"? The code I provided only missed loop bodies.
>> I can provide that too, but I do not think it will add anything to the
>> discussion.
>
> I believe he wants to have real world examples (of other languages) where
> this feature is used. E.g. in some well respected software, library, etc.
Thank you, I understand now.
Python:
https://www.google.com/search?q=site%3Agithub.com+for+%22in+enumerate%22
PHP:
https://www.google.com/search?q=site%3Agithub.com+foreach(%24a+as+%24k+%3D%3E+%24v)
Objective C:
https://www.google.com/search?q=site%3Agithub.com+enumerateObjectsUsingBlock
JavaScript:
https://www.google.com/search?q=site%3Agithub.com+%22forEach(function(value%2C+index%22
Note that I restricted search to a single repository site to avoid
catching various manuals and discussions.
I had also fix parameter names for some languages, because Google does
not support regexp search.
Even with those limitations, you may notice that each search returns
thousands of results.
I do not wish to enter an argument about how "respected" those
languages and projects are --
but I hope it demonstrates unambiguously the popularity of the feature.
--
Alexander S. Klenin
More information about the fpc-devel
mailing list