Paul Ishenin wrote:
Sergei Gorelkin wrote:

Probably yes. A possibility to use any type which has certain methods/operators instead looks attractive, but I'm afraid it would be hard to fit that into existing compiler model.

Sorry, what is TIterator? Is this like to the previosly suggested

TIterator = interator(<Type>, MoveNext, Current)
end;

I did not try to specify what exactly TIterator is. What I tried to say is: "some type that is already known at the point of parsing the for..in".

Btw, we can use some new 'enumerator'/'iterator' directive to mark methods which return enumerators.

And only in delphi mode we will search for the GetEnumerator method.

The question is, what advantage all this specific syntax could give over simple searching the methods by name?


Sergei
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to