[fpc-pascal] Delphi mode for new features?

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jul 2 13:30:07 CEST 2015

Serguei TARASSOV wrote on Thu, 02 Jul 2015:

> Object type can be used as "advanced record" in FPC mode only.
> I'm agreed that it is good evolution since turbo pascal.
> But in Delphi mode you cannot use object type in a same manner (i.e.  
> for operator overloading) and then should use advanced records.

We can't help that. FPC supported operator overloading long before Delphi did.

> As result, when the same unit should be compiled with both Delphi  
> and FPC, you cannot use the power of both languages but only subset  
> of them.

I still don't understand this argument. If you want to compile a unit  
both with FPC and Delphi, develop the code in Delphi (so you don't  
accidentally use FPC-specific routines from the FPC RTL) and use  
{$mode delphi} to compile it in FPC. Of course you can't use  
FPC-specific features if you want to compile your code also with  
Delphi, just like you can't use GCC-specific features if you want to  
compile your code also with MSVC.

Over time, we add all (or at least most) features that Delphi support  
to {$mode delphi}. It's true that we don't immediately support all  
features that Delphi has, but that's not because we refuse to support  
them. It's simply because in an open source project the only features  
that get supported are the ones that people write patches for (and  
these people can be anyone).

For the same reason, not spending time on FPC features would not  
automatically mean that support for Delphi features would be  
implemented sooner: in an open source project, people primarily work  
on what they care about themselves.


More information about the fpc-pascal mailing list