[Lazarus] Choose compiler mode

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

[Lazarus] Choose compiler mode

aradeonas
Hi,

After times I used Lazarus I still have a question about compiler mode.
Why there is 5 mode?What can I do when I want objfpc mode benefits that
is Lazarus default but for example I want advanced record syntax that
can used with Delphi mode?
Can any one explain it to me or  link me to a source?

Regards,
Ara

--
http://www.fastmail.com - IMAP accessible web-mail


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

Felipe Monteiro de Carvalho
On Wed, Mar 11, 2015 at 9:02 AM, aradeonas <[hidden email]> wrote:
> What can I do when I want objfpc mode benefits that
> is Lazarus default but for example I want advanced record syntax that
> can used with Delphi mode?

Split your unit in 2: one in objfpc mode and another in delphi mode.

--
Felipe Monteiro de Carvalho

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

leledumbo
Administrator
In reply to this post by aradeonas
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

Mattias Gaertner
In reply to this post by Felipe Monteiro de Carvalho
On Wed, 11 Mar 2015 10:20:54 +0100
Felipe Monteiro de Carvalho <[hidden email]> wrote:

> On Wed, Mar 11, 2015 at 9:02 AM, aradeonas <[hidden email]> wrote:
> > What can I do when I want objfpc mode benefits that
> > is Lazarus default but for example I want advanced record syntax that
> > can used with Delphi mode?
>
> Split your unit in 2: one in objfpc mode and another in delphi mode.

Or use {$ModeSwitch advancedrecords}.


Mattias

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

aradeonas
ModeSwitch is interesting.
But why they aren't in one mode?I mean all the good stuff in one mode?

Regards,
Ara

On Wed, Mar 11, 2015, at 02:35 AM, Mattias Gaertner wrote:

> On Wed, 11 Mar 2015 10:20:54 +0100
> Felipe Monteiro de Carvalho <[hidden email]> wrote:
>
> > On Wed, Mar 11, 2015 at 9:02 AM, aradeonas <[hidden email]> wrote:
> > > What can I do when I want objfpc mode benefits that
> > > is Lazarus default but for example I want advanced record syntax that
> > > can used with Delphi mode?
> >
> > Split your unit in 2: one in objfpc mode and another in delphi mode.
>
> Or use {$ModeSwitch advancedrecords}.
>
>
> Mattias
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
http://www.fastmail.com - Does exactly what it says on the tin


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

Michael Van Canneyt


On Wed, 11 Mar 2015, aradeonas wrote:

> ModeSwitch is interesting.
> But why they aren't in one mode?I mean all the good stuff in one mode?

What is 'good stuff' ? That depends on the person.

Also: you may want to control compatibility. If we added stuff that we think is fun,
someone uses it in e.g. delphi mode without realizing Delphi doesn't support it,
and suddenly his code no longer compiles in Delphi...

Michael.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

aradeonas
In reply to this post by aradeonas
Like advancedrecords,
For many developers like me that Lazarus is going to be his/her main IDE
and dont care code compatible with Delphi these are boring.
For example Im using Delphi for 10 years and from the time Im using
Lazarus I never need comparability.
I mean while Lazarus and FPC are going to be bigger its good to have a
mode with all good stuff (again like advancedrecords in one place).
But what I know! Im new here.

Regards,
Ara

On Wed, Mar 11, 2015, at 02:49 AM, aradeonas wrote:

> ModeSwitch is interesting.
> But why they aren't in one mode?I mean all the good stuff in one mode?
>
> Regards,
> Ara
>
> On Wed, Mar 11, 2015, at 02:35 AM, Mattias Gaertner wrote:
> > On Wed, 11 Mar 2015 10:20:54 +0100
> > Felipe Monteiro de Carvalho <[hidden email]> wrote:
> >
> > > On Wed, Mar 11, 2015 at 9:02 AM, aradeonas <[hidden email]> wrote:
> > > > What can I do when I want objfpc mode benefits that
> > > > is Lazarus default but for example I want advanced record syntax that
> > > > can used with Delphi mode?
> > >
> > > Split your unit in 2: one in objfpc mode and another in delphi mode.
> >
> > Or use {$ModeSwitch advancedrecords}.
> >
> >
> > Mattias
> >
> > --
> > _______________________________________________
> > Lazarus mailing list
> > [hidden email]
> > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
> --
> http://www.fastmail.com - Does exactly what it says on the tin
>
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
http://www.fastmail.com - Faster than the air-speed velocity of an
                          unladen european swallow


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

leledumbo
Administrator
In reply to this post by aradeonas
> But why they aren't in one mode?I mean all the good stuff in one mode?

Because some of them are intersecting:
- Generics syntax in ObjFPC and Delphi mode are different
- Integer = SmallInt in TP/FPC mode, but LongInt in ObjFPC/Delphi mode

continue the list yourself by reading the docs
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

aradeonas
Ok,Thank you.

Ara

On Wed, Mar 11, 2015, at 08:21 AM, leledumbo wrote:

> > But why they aren't in one mode?I mean all the good stuff in one mode?
>
> Because some of them are intersecting:
> - Generics syntax in ObjFPC and Delphi mode are different
> - Integer = SmallInt in TP/FPC mode, but LongInt in ObjFPC/Delphi mode
>
> continue the list yourself by reading the docs
>
>
>
> --
> View this message in context:
> http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Choose-compiler-mode-tp4041075p4041094.html
> Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
http://www.fastmail.com - Faster than the air-speed velocity of an
                          unladen european swallow


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

Marco van de Voort
In reply to this post by Michael Van Canneyt
On Wed, Mar 11, 2015 at 10:55:07AM +0100, Michael Van Canneyt wrote:
> > ModeSwitch is interesting.
> > But why they aren't in one mode?I mean all the good stuff in one mode?
>
> What is 'good stuff' ? That depends on the person.
>
> Also: you may want to control compatibility. If we added stuff that we think is fun,
> someone uses it in e.g. delphi mode without realizing Delphi doesn't support it,
> and suddenly his code no longer compiles in Delphi...

Mode Delphi doesn't even try to enforce delphi compatibility, so IMHO that
is a stretch.

I would welcome a setting to generate $mode delphi units by default.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

Michael Van Canneyt


On Wed, 11 Mar 2015, Marco van de Voort wrote:

> On Wed, Mar 11, 2015 at 10:55:07AM +0100, Michael Van Canneyt wrote:
>>> ModeSwitch is interesting.
>>> But why they aren't in one mode?I mean all the good stuff in one mode?
>>
>> What is 'good stuff' ? That depends on the person.
>>
>> Also: you may want to control compatibility. If we added stuff that we think is fun,
>> someone uses it in e.g. delphi mode without realizing Delphi doesn't support it,
>> and suddenly his code no longer compiles in Delphi...
>
> Mode Delphi doesn't even try to enforce delphi compatibility, so IMHO that
> is a stretch.

Please elaborate ?

Michael.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Choose compiler mode

Mattias Gaertner
In reply to this post by Marco van de Voort
On Wed, 11 Mar 2015 21:32:51 +0100
Marco van de Voort <[hidden email]> wrote:

>[...]
> I would welcome a setting to generate $mode delphi units by default.

If you mean in Lazarus:
Project Options / Compiler Options / Parsing Syntax Mode

Set this to Delphi. When you create a new unit it creates {$mode
delphi}.


Mattias

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus