Compiler Mode?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiler Mode?

Anthony Walter-3
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?

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Michael Van Canneyt


On Wed, 24 Feb 2016, Anthony Walter wrote:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Maciej Izak
In reply to this post by Anthony Walter-3
2016-02-24 12:48 GMT+01:00 Anthony Walter <[hidden email]>:
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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Graeme Geldenhuys-6
In reply to this post by Michael Van Canneyt
On 2016-02-24 11:57, Michael Van Canneyt wrote:
> We think {$Mode objpas} is the better mode, but this is just our private
> opinion.


I assume you meant:  {$mode objfpc}   ?


Regards,
  - Graeme -

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Michael Van Canneyt
In reply to this post by Maciej Izak


On Wed, 24 Feb 2016, Maciej Izak wrote:

> 2016-02-24 12:48 GMT+01:00 Anthony Walter <[hidden email]>:
>
>> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Michael Van Canneyt
In reply to this post by Graeme Geldenhuys-6


On Wed, 24 Feb 2016, Graeme Geldenhuys wrote:

> On 2016-02-24 11:57, Michael Van Canneyt wrote:
>> We think {$Mode objpas} is the better mode, but this is just our private
>> opinion.
>
>
> I assume you meant:  {$mode objfpc}   ?

Yes, of course, typo...

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Maciej Izak
In reply to this post by Michael Van Canneyt
2016-02-24 13:15 GMT+01:00 Michael Van Canneyt <[hidden email]>:
As said, ours is an opinion. Your mileage may vary.

Phew ;) everyone can be happy!
--
Best regards,
Maciej Izak

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Marco van de Voort
In reply to this post by Michael Van Canneyt
In our previous episode, Michael Van Canneyt said:
>
> As said, ours is an opinion.

... and not unanimous :-)
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

Sven Barth-2
In reply to this post by Maciej Izak

Am 24.02.2016 13:10 schrieb "Maciej Izak" <[hidden email]>:
>
> 2016-02-24 12:48 GMT+01:00 Anthony Walter <[hidden email]>:
>>
>> 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 

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


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compiler Mode?

vojtech.cihak

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

 

V.

______________________________________________________________
> Od: Sven Barth <[hidden email]>
> Komu: "FPC-Pascal users discussions" <[hidden email]>
> 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



----------

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal