[fpc-devel] new features and facilities

2015-10-08 Thread Mohsen
Hi! I wanna add new features and facilities to pascal like while - else, for - else and inline if statement like python. examples ex1: I:=5; while(I>0) do begin Write(I); I:=I-1; end else Write(' While Else '); ex1-output:54321 While Else ex2: I:=5; while(I>0) do begin

Re: [fpc-devel] new features and facilities

2015-10-08 Thread MohsenTi
I know this issue but with changing some of structures, I can implement it and now I only want testing adding features to compiler and don't care about backward compatibility,just testing. I added some changes to compiler functions and classes like pstatmnt.while_statement and

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Michael Van Canneyt
On Thu, 8 Oct 2015, Mohsen wrote: Hi! I wanna add new features and facilities to pascal like while - else, for - else and inline if statement like python. examples ex1: I:=5; while(I>0) do begin Write(I); I:=I-1; end else Write(' While Else '); This cannot be implemented

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Paul Michell
I'm in tomorrow, we can take a look then. Kind regards, Paul On 08/10/15 14:33, Mohsen wrote: Hi! I wanna add new features and facilities to pascal like while - else, for - else and inline if statement like python. examples ex1: I:=5; while(I>0) do begin Write(I); I:=I-1;

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Ondrej Pokorny
On 08.10.2015 17:37, MohsenTi wrote: I know this issue but with changing some of structures, I can implement it and now I only want testing adding features to compiler and don't care about backward compatibility,just testing. I added some changes to compiler functions and classes like

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Mark Morgan Lloyd
Ondrej Pokorny wrote: As Michael has said, adding an extra else or for that matter otherwise would be a problem. And what about the inline if? That should be backwards compatible at a first glance. And it would be a fun thing because the Delphi community has asked for it for many years

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Sven Barth
Am 08.10.2015 17:37 schrieb "MohsenTi" : > > I know this issue but with changing some of structures, I can implement it and now I only want testing adding features to compiler and don't care about backward compatibility,just testing. I wouldn't integrate it in the

Re: [fpc-devel] new features and facilities

2015-10-08 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 08 Oct 2015 16:12:56 +, Mark Morgan Lloyd (markmll.fpc-de...@telemetry.co.uk) wrote about "Re: [fpc-devel] new features and facilities" (in ): > Ondrej Pokorny wrote: > > As Michael has said,

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Sven Barth
Am 08.10.2015 17:43 schrieb "Ondrej Pokorny" : > > On 08.10.2015 17:37, MohsenTi wrote: >> >> I know this issue but with changing some of structures, I can implement it and now I only want testing adding features to compiler and don't care about backward compatibility,just

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Ondrej Pokorny
On 08.10.2015 18:54, Sven Barth wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks very Pascal and shouldn't break anything: left := if expr1 then expr2 else expr3; Thereby expr1 returns Boolean and expr2 determines the

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Ralf Quint
On 10/8/2015 9:54 AM, Sven Barth wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks very Pascal and shouldn't break anything: left := if expr1 then expr2 else expr3; Thereby expr1 returns Boolean and expr2 determines

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Ralf Quint
On 10/8/2015 10:35 AM, Mark Morgan Lloyd wrote: Indeed, it is even more succinct in C/C++: x = ? : ; At which point you'll have various members of the Pascal community decrying it as too C-like. Well, the tenary operator as present in C(++) is a shortcut for a simple if-then-else,

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Carlo Kok
Op 2015-10-08 om 19:25 schreef Dmitry Boyarintsev: On Thu, Oct 8, 2015 at 12:54 PM, Sven Barth > wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Dmitry Boyarintsev
On Thu, Oct 8, 2015 at 12:54 PM, Sven Barth wrote: > I had the idea to implement inline-if as well. I think the syntax I > selected is derived from Oxygene, but it looks very Pascal and shouldn't > break anything: > > left := if expr1 then expr2 else expr3; > >

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Mark Morgan Lloyd
David W Noon wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 08 Oct 2015 16:12:56 +, Mark Morgan Lloyd (markmll.fpc-de...@telemetry.co.uk) wrote about "Re: [fpc-devel] new features and facilities" (in ): Ondrej Pokorny wrote: As

Re: [fpc-devel] new features and facilities

2015-10-08 Thread MohsenTi
Thank you Sven, is there any documentation about freepascal compiler parts ? On Thu, Oct 8, 2015 at 8:27 PM, Sven Barth wrote: > Am 08.10.2015 17:37 schrieb "MohsenTi" : > > > > I know this issue but with changing some of structures, I can

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Mark Morgan Lloyd
Ralf Quint wrote: On 10/8/2015 9:54 AM, Sven Barth wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks very Pascal and shouldn't break anything: left := if expr1 then expr2 else expr3; Thereby expr1 returns Boolean and

Re: [fpc-devel] patch for rtl/linux/aarch64/cprt0.as

2015-10-08 Thread Jonas Maebe
On 06/10/15 20:50, Edmund Grimley Evans wrote: But perhaps you'll want to consider fpc-x86_64-cprt0.patch (attached) for the trunk. I can confirm that it doesn't break Debian's build. Perhaps someone else can test it in some other way. I've run the testsuite and didn't see any regressions on

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Michael Van Canneyt
On Thu, 8 Oct 2015, Sven Barth wrote: Am 08.10.2015 19:10 schrieb "Ralf Quint" : On 10/8/2015 9:54 AM, Sven Barth wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks very Pascal and shouldn't

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Thu, 8 Oct 2015, Sven Barth wrote: Am 08.10.2015 19:10 schrieb "Ralf Quint" : On 10/8/2015 9:54 AM, Sven Barth wrote: I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Sven Barth
Am 08.10.2015 19:10 schrieb "Ralf Quint" : > > On 10/8/2015 9:54 AM, Sven Barth wrote: >> >> >> I had the idea to implement inline-if as well. I think the syntax I selected is derived from Oxygene, but it looks very Pascal and shouldn't break anything: >> >> left := if expr1

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Ralf Quint
On 10/8/2015 2:07 PM, Sven Barth wrote: And you think C's ternary would be more Pascal? Well, no. While I use the ternary operator quite a bit when using C, as it IMHO allows for a cleaner formatting of code there, in Pascal, I always use a cleanly formatted If-then-else. Ralf --- This

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Michael Van Canneyt
On Thu, 8 Oct 2015, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: On Thu, 8 Oct 2015, Sven Barth wrote: Am 08.10.2015 19:10 schrieb "Ralf Quint" : On 10/8/2015 9:54 AM, Sven Barth wrote: I had the idea to implement inline-if as well. I think the syntax I

Re: [fpc-devel] new features and facilities

2015-10-08 Thread Martin Frb
On 08/10/2015 23:18, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: Let me explain. If I see If expr1 then expr2 else expr3 it says 'statement' to me. But a ? b : c; Says "expression" to me. The way I look at it is that it's restoring a feature that was (possibly accidentally)