Re: [fpc-pascal] Forin Test

2009-11-07 Thread Paul Ishenin
Dariusz Mazur wrote: with hack with trivial operator we receive the same: for CollectionElement in Collection.CollectionEnumerator do yes, but it is still the hack but what about for CollectionElement in Collection using TreeEnumerator do where TreeEnumerator cant traverse thought Collection

Re: [fpc-pascal] Forin Test

2009-11-07 Thread Dariusz Mazur
Paul Ishenin pisze: Of course. for-in loop expect to have a collection not an enumerator. What enumerator should for-in loop to choose in the next case: [example] TMyListEnumerator = class public function GetEnumerator: TMyListEnumeratorEnumerator; function MoveNext: Boolean; property Curren

Re: [fpc-pascal] Forin Test

2009-11-07 Thread Paul Ishenin
Dariusz Mazur wrote: Can You give example of this: where for i in List using GetEnumerator is better than for i in List.GetEnumerator Of course. for-in loop expect to have a collection not an enumerator. What enumerator should for-in loop to choose in the next case: [example] TMyListEnumerat

Re: [fpc-pascal] Forin Test

2009-11-07 Thread Dariusz Mazur
Paul Ishenin pisze: Dariusz Mazur wrote: Where? Its work now with current compilator. Are You plan to disable this? I made a typo: read 'I see *no* problems with this'. for i in List using GetEnumerator(DoUpArgument) current "for i in List" will be just short form of "for i in List using Ge

Re: [fpc-pascal] Forin Test

2009-11-07 Thread Paul Ishenin
Dariusz Mazur wrote: Where? Its work now with current compilator. Are You plan to disable this? I made a typo: read 'I see *no* problems with this'. 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 thi

Re: [fpc-pascal] Forin Test

2009-11-07 Thread Dariusz Mazur
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; begin Result := AEnumerato

Re: [fpc-pascal] Forin Test

2009-11-07 Thread Paul Ishenin
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; begin Result := AEnumerator end; It is a bit h