Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-07

Re: Delphi mode for new features?

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Serguei TARASSOV
Show quoted text 11 lines
Date: Wed, 1 Jul 2015 17:51:43 +0200 From: Jonas Maebe To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] Delphi mode for new features? The point is that we consider that several features added by Embarcadero make the language less Pascal-like or more complicated for no good reason. "Advanced records" is one such example: that feature already existed, and is called "objects" or "Turbo Pascal-style objects".

This is another good example of divergence that complicates the life.

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. 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.

Be honest, I have doubts about "Pascal spirit" of this genre.

Regards,
Serguei

Reply by email

Jonas Maebe
to Serguei TARASSOV

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.

Jonas

Reply by email

Florian Klaempfl
to Serguei TARASSOV: This is another good example of divergence that complicates the life. Object type can be…
Serguei TARASSOV wrote
Be honest, I have doubts about "Pascal spirit" of this genre.

FPC tries to support all flavours of pascal, even ISO. If you are interested only in one flavour, just add the appropriate mode switch to your config and be done. If FPC limited itself only to one flavour, it wouldn't probably exist anymore/being dead.

Reply by email