On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong and should not be used other than for people or companies trying to convert Delphi code to Free Pascal.
What's the official position on this point?

Mailing lists / fpc-pascal / 2016-02
10 messages · 7 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong and should not be used other than for people or companies trying to convert Delphi code to Free Pascal.
What's the official position on this point?
People are free to use whatever mode suits them best.
But {$Mode delphi} is intended to make the compiler behave as much as possible as the Delphi compiler, and thus should be most suitable for companies trying to convert Delphi code to Free Pascal.
We think {$Mode objpas} is the better mode, but this is just our private opinion.
Note that the mode switch says only something about the available Object Pascal language constructs when compiling code.
It also doesn't say anything about behaviour of other units in your current code. In particular: It doesn't say anything about the available identifiers in units that are available both in Delphi and FPC. (sysutils, classes, db).
Michael.
On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong and should not be…
2016-02-24 12:48 GMT+01:00 Anthony Walter :
Delphi is IMO the best available mode. ObjPas is unusable for me for many reasons, few of them:
* Different parsing of comments
* Unlogical approach for static; modifier (I can't use static methods as callback in objfpc... the main reason of introducing static in Delphi is callback for api...)
* I cant use the same name for class var and for parameter in method http://bugs.freepascal.org/view.php?id=24963
* generic and specialize keyword hell in extensively used generics...
People are free to use whatever mode suits them best. But {$Mode delphi} is intended to…
Michael Van Canneyt wroteWe think {$Mode objpas} is the better mode, but this is just our private opinion.
I assume you meant: {$mode objfpc} ?
Regards,
- Graeme -
2016-02-24 12:48 GMT+01:00 Anthony Walter : Delphi is IMO the best available mode. ObjPas…
As said, ours is an opinion. Your mileage may vary.
Michael.
I assume you meant: {$mode objfpc} ? - Graeme -
Yes, of course, typo...
Michael.
As said, ours is an opinion. Your mileage may vary. Michael.
2016-02-24 13:15 GMT+01:00 Michael Van Canneyt :
As said, ours is an opinion. Your mileage may vary.
Phew ;) everyone can be happy!
As said, ours is an opinion. Your mileage may vary. Michael.
In our previous episode, Michael Van Canneyt said:
As said, ours is an opinion.
... and not unanimous :-)
2016-02-24 12:48 GMT+01:00 Anthony Walter : Delphi is IMO the best available mode. ObjPas…
"Maciej Izak" wrote2016-02-24 12:48 GMT+01:00 Anthony Walter : > > On another forum a Free Pascal user opined that {$MODE DELPHI} is wrong
and should not be used other than for people or companies trying to convert Delphi code to Free Pascal.
reasons, few of them:
* Different parsing of comments
Which is better in ObjFPC as it allows nesting of comments.
* Unlogical approach for static; modifier (I can't use static methods as
callback in objfpc... the main reason of introducing static in Delphi is callback for api...)
AFAIK that's a general problem we currently have with static and not just restricted to mode ObjFPC. At least in my opinion the assignment of such methods to normal procedure variables should be possible no matter which mode is selected.
* I cant use the same name for class var and for parameter in method
http://bugs.freepascal.org/view.php?id=24963
That's by design.
* generic and specialize keyword hell in extensively used generics...
On the other hand complex inline specialization expressions work in mode ObjFPC, while they don't in mode Delphi...
Regards,
Sven
Assigning static class methods to procedure variables in ObjFPC would be very nice feature.
V.
______________________________________________________________
AFAIK that's a general problem we currently have with static and not just restricted to mode ObjFPC. At least in my opinion the assignment of such methods to normal procedure variables should be possible no matter which mode is selected.
Regards,
Sven
----------