[fpc-devel] for-in-index loop

Василий Кевролетин kevroletin at gmail.com
Fri Jan 25 04:47:38 CET 2013


Hi all,

I want to clarify what *feature will be optional* and will not break
compatibility. I suppose what back compatibility is required for all minor
changes. *I was thinking it's always by default :)*

*Michael Van Canneyt*,

> FPC is not the playground for every possible idea out there.
> If someone wants to implement some weird syntax: please; use FPC to try
and test it, create your dissertation, whatnot.
May be you understood what I'm from university in wrong way. It does
*not*mean what I need to quickly do any changes anywhere. It means
what I have
resources *(time, motivation, direct support of very good programmer) *to
improve good open project. Work will not have any good value for me if
results of work will not have any good value for other people.

> "For in" is debatable by itself. It is syntactical sugar, it provides
nothing that for a:=b to c does not give.
> Now you propose to extend this "sugar" syntax with something even more
exotic, which I have not even encountered in other languages.
1. Syntax is subject of discussion and can be changed.
2. Freepascal already have for-in syntax sugar. Why not to make it more
flexible?

Request of this what for-in-index is on fpc wiki. Some other pascal
programmers told in this thread what this is good feature.
Evolution of other popular programming languages shows what for-in-index
loop have real value *(describes by Alexander S. Klenin)*.
Implementation of  for-in-index will be basad on existing for-in loop. Thus
feature will have almost same behavior as for-in loop. All implementation
problems described in this thread relate to existing for-in loop. They are
not relevant to discussion of for-in-index loop.

I understand why you don't want to support bad features. But I don't
understand why reasonable extension of existing feature (which will not
break compatibility and which exists in other languages) is bad ? :)

Best regards,
Vasiliy Kevroletin


2013/1/25 Paul Ishenin <ip at kmiac.ru>

> 25.01.2013 4:32, Alexander Klenin пишет:
>
>  On Fri, Jan 25, 2013 at 7:18 AM, Jeppe Græsdal Johansen
>> <jjohan07 at student.aau.dk> wrote:
>>
>>>
>>> I think the idea is good if the feature is implemented as "optional".
>>>
>>> That way:
>>> - If the enumerator class implements a CurrentIndex method then the for
>>> loop
>>> can have an index variable.
>>> - If not then the for loop can only behave as current for in loops.
>>>
>>>  Of course.
>>
>
> Then I also have nothing against this feature. If it is controllable by
> enumrator to allow/reject this then it is ok.
>
> Best regards,
> Paul Ishenin
>
>
> ______________________________**_________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/**mailman/listinfo/fpc-devel<http://lists.freepascal.org/mailman/listinfo/fpc-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130125/f2e2a586/attachment.html>


More information about the fpc-devel mailing list