[fpc-devel] [] property overloads
Ryan Joseph
genericptr at gmail.com
Thu Jun 20 21:36:48 CEST 2019
> On Jun 20, 2019, at 2:17 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>
> IMHO this goes contrary to what the word 'default' means. There can be only
> 1 default.
I think the name of “default” was probably a mistake and it should have been “nameless” or something similar. Not sure why it was chosen but it’s going to be giving us problems.
>
> That said, allowing overloading of array properties based on index type has been on my wish list since a long time.
>
> So
> property Values[index: integer]: TValue read GetValue;
> property Values[index: string]: TValue read GetValue; would be a nice addition.
>
> Since the Values array is then uniquely named, 'Default' makes sense again.
The values array is uniquely named? Looks the same to me. Properties don’t support duplicate identifiers though and the real issue is being able to do c[0] or c[‘key’] without the property name. It feels to me like we’re being held back by the choice of the word default. How can we get around that? Seems like a silly thing to be getting in our way.
Regards,
Ryan Joseph
More information about the fpc-devel
mailing list