[fpc-pascal] Delphi mode for new features?

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jul 1 16:54:30 CEST 2015


Serguei TARASSOV wrote on Wed, 01 Jul 2015:

> As I see (may be mistaken), some _new_ Delphi features are available  
> only in $MODE DELPHI.
> This way lead to divergence of two compilers.
>
> Why do not implement them in FPC "by default" (when it not  
> constrained by basic concepts and legacy code) to take the road of  
> convergence?

Such new Delphi features are only enabled by default in FPC modes if  
we consider them to not run counter to the spirit of Pascal. That's  
obviously subjective, but so is Embarcadero's decision to introduce  
them. There will never be convergence, because Embarcadero is not  
interested in that.

> I.e. record functions/constructors may reduce the code and make it more safe.

You can use {$modeswitch advancedrecords} to enable them in any  
non-Delphi syntax mode  
(http://www.freepascal.org/docs-html/prog/progsu106.html ). Virtually  
all new language features we add these days can be selectively enabled  
and disabled via mode switches.


Jonas



More information about the fpc-pascal mailing list