[fpc-devel] Postfix operator overload or default properties

Sven Barth pascaldragon at googlemail.com
Fri Jun 7 22:56:24 CEST 2019


Am 07.06.2019 um 22:50 schrieb Ryan Joseph:
>
>> On Jun 7, 2019, at 4:47 PM, Sven Barth via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
>>
>> Am 07.06.2019 um 22:41 schrieb Ryan Joseph:
>>> Does that make sense? I’d like to scratch the idea of default properties and do this instead if it was permitted.
>> No. FPC is not going down that operator madness.
> So why are default properties better? I thought the compiler team would like the idea of . overloads because it’s so much less intrusive on the compiler and more predictable for the user. Please explain your reasoning if you don’t mind.
Because I don't want to open the can of worms that is going to be 
overloading the postfix "operator". People are going to abuse the hell 
out of it (they will with default properties as well, don't get me wrong 
there), making the language much harder to read. Nowadays you can rely 
on the "." denoting some sub element. With operator overload using a "." 
could mean triggering some credit card payment (I'm exaggerating here, 
but this would technically be possible).
Default field properties extend a mechanism that already exists and also 
have a much narrower scope of possibilities for abuse.

Regards,
Sven



More information about the fpc-devel mailing list