[fpc-pascal] Forin Test
darekm at emadar.com
Sat Nov 7 13:29:17 CET 2009
Paul Ishenin pisze:
> darekm wrote:
>> I've play with forin construction. To my work I need more than one
>> per collection.
>> In attach is one of example program.
>> Can someone review it. is this proper construction.
> operator enumerator (AEnumerator: TEnumerator): TEnumerator;
> Result := AEnumerator
> It is a bit hackish but I see problems with it.
Its work now with current compilator. Are You plan to disable this?
> for i in List.up do
> will be possible to transform into
> for i in List using Up do
> for i in List using GetEnumerator(DoUpArgument)
> current "for i in List" will be just short form of "for i in List
> using GetEnumerator"
But this complicate both: source and compilator.
And second: You cant pass enumerator as param.
procedure MyProc(aEnum: tObject);
i : integer;
for i in aEnum do
More information about the fpc-pascal