Sign in Join

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

Mailing lists / fpc-pascal / 2016-02

Compiler Mode?

10 messages · 7 people ·

Reply by email Subscribe to this list Your subscription

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

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.

What's the official position on this point?

Michael Van Canneyt
to Anthony Walter
Anthony Walter wrote 5 lines
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.

Maciej Izak
to Anthony Walter: 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 :

Show quoted text 6 lines
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?

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

Best regards, Maciej Izak
Michael Van Canneyt
to Maciej Izak: 2016-02-24 12:48 GMT+01:00 Anthony Walter : Delphi is IMO the best available mode. ObjPas…
Maciej Izak wrote 19 lines
2016-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. > > What's the official position on this point? > 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...

As said, ours is an opinion. Your mileage may vary.

Michael.

Sven Barth
to Maciej Izak: 2016-02-24 12:48 GMT+01:00 Anthony Walter : Delphi is IMO the best available mode. ObjPas…
"Maciej Izak" wrote
2016-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.

Show quoted text 5 lines
> > What's the official position on this point? Delphi is IMO the best available mode. ObjPas is unusable for me for many

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

Vojtěch Čihák
to Sven Barth

Assigning static class methods to procedure variables in ObjFPC would be very nice feature.  
V.
______________________________________________________________

Show quoted text 6 lines
Od: Sven Barth Komu: "FPC-Pascal users discussions" Datum: 24.02.2016 17:22 Předmět: Re: [fpc-pascal] Compiler Mode? * 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.  
Regards,
Sven

----------