Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Ondrej Pokorny
On 10.10.2015 16:58, Michael Van Canneyt wrote: The class does not need to have a default property to begin with, so it is somewhere logical. Yes, in that case a default enumerator would not be allowed, which sounds (in contrary) logical to me: no default array property => no enumerator. But th

Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Michael Van Canneyt
On Sat, 10 Oct 2015, Ondrej Pokorny wrote: Oh, it would be so nice if default enumerator wasn't defined with the "GetEnumerator" function but with the default property: TTest = class // ... function GetObjectEnumerator: TTestObjectEnumerator; property Objects[Index: Integer]: TObje

Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Ondrej Pokorny
Oh, it would be so nice if default enumerator wasn't defined with the "GetEnumerator" function but with the default property: TTest = class // ... function GetObjectEnumerator: TTestObjectEnumerator; property Objects[Index: Integer]: TObject read GetObject enumerator GetObjectEnum

Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Ondrej Pokorny
On 10.10.2015 12:41, Michael Van Canneyt wrote: 100% agreed :) Great! I wrote a feature request in mantis for it so that we don't forget about it and can follow it there: http://bugs.freepascal.org/view.php?id=28820 Ondre ___ fpc-devel maillist -

Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Michael Van Canneyt
On Sat, 10 Oct 2015, Ondrej Pokorny wrote: On 10.10.2015 12:30, Michael Van Canneyt wrote: After a sed s/iterator/enumerator/g I'm all for it. + Yes, the "in Self" is supported. But this is not the problem here. The example still doesn't compile. A class can have more array properties. A

Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Ondrej Pokorny
On 10.10.2015 12:30, Michael Van Canneyt wrote: After a sed s/iterator/enumerator/g I'm all for it. I've been looking how to implement names/objects/values enumerators in TStrings. This would be the almost perfect solution. But your example is not well-chosen, since the enumerator for TCom

Re: [fpc-devel] Iterator for array properties

2015-10-10 Thread Michael Van Canneyt
On Sat, 10 Oct 2015, Ondrej Pokorny wrote: When we are already discussing new language features, what about supporting iterators for array properties: TTest = class // ... property Objects[Index: Integer]: TObject read GetObject *iterator GetObjectIterator*; property ObjectCount:

[fpc-devel] Iterator for array properties

2015-10-10 Thread Ondrej Pokorny
When we are already discussing new language features, what about supporting iterators for array properties: TTest = class // ... property Objects[Index: Integer]: TObject read GetObject *iterator GetObjectIterator*; property ObjectCount: Integer read GetObjectCount; end; This