Re: [fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-09 Thread Marcos Douglas
On Mon, Nov 9, 2015 at 7:47 AM, Graeme Geldenhuys wrote: > Not to be a stickler, but that is not an ideal interface either (in my > eyes). Not everything is a "file", so EOF (End-of-File) was really not a > good choice. eg: Iterating characters in a String, Objects in a > ObjectList etc... none re

Re: [fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-09 Thread Graeme Geldenhuys
On 2015-11-08 18:38, leledumbo wrote: > It := SomeContainer.Iterator; > while not It.EOF do begin > ... > It.Next; > end; Not to be a stickler, but that is not an ideal interface either (in my eyes). Not everything is a "file", so EOF (End-of-File) was really not a good choice. eg: Iterating c

Re: [fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-09 Thread leledumbo
> I'd say don't change. In my opinion the need to restructure one's code outweighs that disadvantage. If anything then add a for-in compatible iterator like was done for TVector<>. Didn't realize that the support is already there, I'll just change to for-in loop then. Silly me :S -- View thi

Re: [fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-08 Thread Sven Barth
Am 08.11.2015 22:36 schrieb "Michael Van Canneyt" : > > > > On Sun, 8 Nov 2015, Sven Barth wrote: > >> On 08.11.2015 19:38, leledumbo wrote: >>> >>> FCL-STL from the start has different iterator usage pattern compared to >>> existing containers (say a TSQLQuery). i.e. the common pattern is: >>> >>>

Re: [fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-08 Thread Michael Van Canneyt
On Sun, 8 Nov 2015, Sven Barth wrote: On 08.11.2015 19:38, leledumbo wrote: FCL-STL from the start has different iterator usage pattern compared to existing containers (say a TSQLQuery). i.e. the common pattern is: It := SomeContainer.Iterator; while not It.EOF do begin ... It.Next; en

Re: [fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-08 Thread Sven Barth
On 08.11.2015 19:38, leledumbo wrote: FCL-STL from the start has different iterator usage pattern compared to existing containers (say a TSQLQuery). i.e. the common pattern is: It := SomeContainer.Iterator; while not It.EOF do begin ... It.Next; end; instead, it uses: It := SomeContainer

[fpc-pascal] Changing iterator usage pattern in FCL-STL

2015-11-08 Thread leledumbo
FCL-STL from the start has different iterator usage pattern compared to existing containers (say a TSQLQuery). i.e. the common pattern is: It := SomeContainer.Iterator; while not It.EOF do begin ... It.Next; end; instead, it uses: It := SomeContainer.Iterator; repeat ... until not It.Next;