[fpc-devel] New feature discussion: for-in loop
Michael Van Canneyt
michael at freepascal.org
Tue Oct 20 09:50:21 CEST 2009
On Tue, 20 Oct 2009, Paul Ishenin wrote:
> Hello, FPC developers' list.
>
> I think we can close 'sealed/abstract class' page and open another
> interesting topc.
>
> It is obvious you are full of energy to discuss new language features.
>
> The next feature which we should think of is for-in loop:
> http://wiki.lazarus.freepascal.org/for-in_loop
>
> There you can find:
> 1. Delphi implementation details
> 2. Proposed extended syntax
> 3. Proposed compiler implementation
>
> While discussion please try to have delphi compatibility in the mind.
At least one of the reasons we never did implement for-in is the absolutely
horrible and totally wrong idea to use classes/interfaces for this, to which
I seriously objected.
The guy who thought of that should be shot, hanged, guillotined and poisoned.
(you pick your order) It is a total negation of everything that pascal stands for:
let a language feature (for in) depend on a user-class implementation.
I can understand
for y in enumerated do
or
For y in set do
or
For Y in range do
Because this seems a natural extension of loops to enumerates (and even
then) But not ever the class-based one.
Michael.
More information about the fpc-devel
mailing list