[fpc-devel] [] property overloads

Ryan Joseph genericptr at gmail.com
Thu Jun 20 22:12:56 CEST 2019



> On Jun 20, 2019, at 3:58 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> The point is that there is in my example only 'Values' which is a unique name. Making that 'Default' just means that the 'Values' keyword can be left out.
> making the 'Values' array the single default.

Got it. The default is “values”.

> I always felt it silly that I must do
> 
> MyStrings.Items[0]
> and
> MyStrings.Values['Name']
> 
> when the compiler could perfectly see what overload to use when I type
> 
> MyStrings.items[0] MyStrings.items['Name']
> And, by extension
> MyStrings[0] MyStrings['Name']
> 
> Still you must be careful, because what is meant by
> MyStrings['0'] ... is it a type error or is actually the name meant ?

It’s basically the same as any other overloaded method so I don’t see where the problem could be.

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list