[fpc-pascal] Custom operators for non-record types

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Jul 2 16:51:35 CEST 2012


JC Chu wrote on Mon, 02 Jul 2012:

> On Mon, Jul 2, 2012 at 3:54 PM, Sven Barth  
> <pascaldragon at googlemail.com> wrote:
>> Maybe there were reasons to not allow them... You can of course prepare a
>> bug report or wait till one of the other developers who are more experienced
>> in FPC's overloading speak up.
>
> Anyway, here’s a patch for reviewing…

Going to a situation where overloading is allowed by default is not  
good. It's too easy to miss something (because there is no formal  
specification of the language anywhere), and then in subsequent  
releases you may have to have to break existing code because you have  
to disable certain overloads again.

By explicitly allowing particular operation overloads and forbidding  
the rest, the risk of having to break backward compatibility later on  
is much smaller (at least if every exception is carefully considered).


Jonas



More information about the fpc-pascal mailing list