Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-14 Thread Nikolai Zhubr
Hi all, 14.10.2015 23:44, Walter Prins: On 14 October 2015 at 07:28, Martin Schreiber mailto:mse00...@gmail.com>> wrote: On Tuesday 13 October 2015 23:25:03 Michael Van Canneyt wrote: > However, I seem to be one of the very few thinking this given the > enthousiasm with which peo

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-14 Thread Walter Prins
On 14 October 2015 at 07:28, Martin Schreiber wrote: > On Tuesday 13 October 2015 23:25:03 Michael Van Canneyt wrote: > > However, I seem to be one of the very few thinking this given the > > enthousiasm with which people are discussing this. > > > > We are at least two people. :-) > For what it

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-14 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: But the existence of such a continue block shows the fundamental issue on which a decision is needed. should (if a volunteer for a patch exists) every little "save one statement in your code helper" be added? Because there are thousands of them, and if you add them a

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Martin Schreiber
On Tuesday 13 October 2015 23:25:03 Michael Van Canneyt wrote: > > But the existence of such a continue block shows the fundamental issue on > > which a decision is needed. should (if a volunteer for a patch exists) > > every little "save one statement in your code helper" be added? Because > > th

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Mattias Gaertner
On Tue, 13 Oct 2015 23:25:03 +0200 (CEST) Michael Van Canneyt wrote: >[...] > The argument that we can refrain from using these new features does not hold, > because other people will be using it, and we will have to know all of it to > be able to understand their code. And it costs precious ti

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Dmitry Boyarintsev
On Tue, Oct 13, 2015 at 5:25 PM, Michael Van Canneyt wrote: > However, I seem to be one of the very few thinking this given the > enthousiasm with which people are discussing this. > Even Niklaus Wirth regrets about bloating languages: https://www.youtube.com/watch?v=BJIqHIYSDrk thanks, Dmitry

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Michael Van Canneyt
On Tue, 13 Oct 2015, Martin Frb wrote: wkitt...@windstream.net wrote: a... my bad... sorry 'bout that... i've been thinking about this, too... 'else' and 'otherwise' mean the same thing... what they seem to be looking for is 'aswell'... foo := 0; while foo < 100 do begin inc(foo

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Martin Frb
wkitt...@windstream.net wrote: a... my bad... sorry 'bout that... i've been thinking about this, too... 'else' and 'otherwise' mean the same thing... what they seem to be looking for is 'aswell'... foo := 0; while foo < 100 do begin inc(foo); end; aswell begin dec(foo); en

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Sven Barth
Am 13.10.2015 19:21 schrieb : >> >> If somebody really has to do this wouldn't "also" be a better choice to avoid >> (getting close to overloading "as"? :-/ > > > it might... i don't know anything about "as" because i've never used it... what does it do? It's an operator for casting classes and in

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Ralf Quint
On 10/13/2015 1:32 AM, Michael Van Canneyt wrote: I don't understand why anyone would want this marginal functionality and thus (again) needlessly complicates the language, but hey, it's a (mostly) free world Alas, the monstrosity that Object Pascal syntax is becoming is less and less

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread wkitty42
On 10/13/2015 09:40 AM, Mark Morgan Lloyd wrote: wkitt...@windstream.net wrote: a... my bad... sorry 'bout that... i've been thinking about this, too... 'else' and 'otherwise' mean the same thing... what they seem to be looking for is 'aswell'... foo := 0; while foo < 100 do begin in

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 12 Oct 2015 21:32:07 -0400, Wkitty42 (wkitt...@windstream.net) wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in <561c5f17.4070...@windstream.net>): [snip] > that looks very much like what some

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 12 Oct 2015 22:34:03 -0300, Flávio Etrusco (flavio.etru...@gmail.com) wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in ): > On Mon, Oct 12, 2015 at 7:15 PM, David W Noon > wrote: [snip] >> loop_1:

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Mark Morgan Lloyd
wkitt...@windstream.net wrote: On 10/13/2015 04:32 AM, Michael Van Canneyt wrote: On Mon, 12 Oct 2015, wkitt...@windstream.net wrote: On 10/12/2015 03:43 PM, Martin Frb wrote: Actually the above does not represent what the actual feature request is about The "else" is to be executed, afte

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread wkitty42
On 10/13/2015 04:32 AM, Michael Van Canneyt wrote: On Mon, 12 Oct 2015, wkitt...@windstream.net wrote: On 10/12/2015 03:43 PM, Martin Frb wrote: Actually the above does not represent what the actual feature request is about The "else" is to be executed, after the while (even if the while lo

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Sven Barth
Am 13.10.2015 08:36 schrieb "Jonas Maebe" : > > Sven Barth wrote: >> >> The intrafunctional gotos not really. But the interfunctional ones >> (modeswitch nonlocalgoto in 2.7.1+) might mess with managed types ;) > > > The compiler should give an error if you try to "goto" out of or into a frame than

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-13 Thread Michael Van Canneyt
On Mon, 12 Oct 2015, wkitt...@windstream.net wrote: On 10/12/2015 03:43 PM, Martin Frb wrote: Actually the above does not represent what the actual feature request is about The "else" is to be executed, after the while (even if the while looped ZERO times). But it is to be skipped if the

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Jonas Maebe
Sven Barth wrote: The intrafunctional gotos not really. But the interfunctional ones (modeswitch nonlocalgoto in 2.7.1+) might mess with managed types ;) The compiler should give an error if you try to "goto" out of or into a frame than needs initialisation/finalisation. Jonas _

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Sven Barth
Am 13.10.2015 03:34 schrieb "Flávio Etrusco" : > > On Mon, Oct 12, 2015 at 7:15 PM, David W Noon > wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > On Mon, 12 Oct 2015 15:11:18 -0400, Wkitty42 (wkitt...@windstream.net) > > wr

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Flávio Etrusco
On Mon, Oct 12, 2015 at 7:15 PM, David W Noon wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Mon, 12 Oct 2015 15:11:18 -0400, Wkitty42 (wkitt...@windstream.net) > wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in > <561c05d6.4010.

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 06:15 PM, David W Noon wrote: On Mon, 12 Oct 2015 15:11:18 -0400, Wkitty42 (wkitt...@windstream.net) wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in <561c05d6.4010...@windstream.net>): On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote: The

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 05:19 PM, Sven Barth wrote: Am 12.10.2015 22:48 schrieb mailto:wkitt...@windstream.net>>: > anyway, it seems that no matter what the discussion, it won't make it into the compiler... that according to another post from a compiler dev ;) I said that I'm not sure. it wasn't you th

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 12 Oct 2015 23:15:31 +0100, David W Noon (david.w.n...@googlemail.com) wrote about "Re: [fpc-devel] Fwd: While - - Otherwise Statement" (in <561c3103.1060...@googlemail.com>): [snip] > IF some_condition THEH IF anothe

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 12 Oct 2015 15:11:18 -0400, Wkitty42 (wkitt...@windstream.net) wrote about "Re: [fpc-devel] Fwd: While - Otherwise Statement" (in <561c05d6.4010...@windstream.net>): > On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote: &

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Sven Barth
Am 12.10.2015 22:48 schrieb : > anyway, it seems that no matter what the discussion, it won't make it into the compiler... that according to another post from a compiler dev ;) I said that I'm not sure. Right now I'm considering that mostly as way for the author to learn about the ways to extend t

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Sven Barth
Am 12.10.2015 21:43 schrieb "Martin Frb" : >> The only drawback is that "cond" is calculated twice instead of once >> before the actual loop body -- not all will be happy.. ;-) >> > Thats an issue for the optimizer. no need to change the language. The optimizer might not be able to do anything if

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 04:10 PM, Dmitry Boyarintsev wrote: On Mon, Oct 12, 2015 at 3:47 PM, mailto:wkitt...@windstream.net>> wrote: by checking the value that caused the break ;) deity knows i've done it many times before back in the TP/BP 6&7 days... i did it exactly as described, too... we

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 03:43 PM, Martin Frb wrote: Actually the above does not represent what the actual feature request is about The "else" is to be executed, after the while (even if the while looped ZERO times). But it is to be skipped if the while exited via break (and only then). For that reason "e

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Dmitry Boyarintsev
On Mon, Oct 12, 2015 at 3:47 PM, wrote: > by checking the value that caused the break ;) deity knows i've done it > many times before back in the TP/BP 6&7 days... i did it exactly as > described, too... we had to do it that way as there is/was no other way to > do it ;) That's exactly the thin

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 03:33 PM, Dmitry Boyarintsev wrote: On Mon, Oct 12, 2015 at 3:11 PM, mailto:wkitt...@windstream.net>> wrote: On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote: The next step would probably be controlled "break", where a user would be able to specify ho

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Martin Frb
On 12/10/2015 20:01, Max Nazhalov wrote: I can't think of a use case either. And just because another language provides such a solution, does not imply that FPC should. +1 (despite my earlier contribution) Discussion of the feature below, is regardless of it not being desirable (in any form)

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Dmitry Boyarintsev
On Mon, Oct 12, 2015 at 3:11 PM, wrote: > On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote: > >> >> The next step would probably be controlled "break", where a user would be >> able >> to specify how many nested loops needed to broken from. >> > > ROTFLMAO! if you need or desire something like th

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 02:02 PM, Dmitry Boyarintsev wrote: The next step would probably be controlled "break", where a user would be able to specify how many nested loops needed to broken from. ROTFLMAO! if you need or desire something like that then set a breakcounter and break... in the next outer b

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread wkitty42
On 10/12/2015 01:47 PM, Dmitry Boyarintsev wrote: On Mon, Oct 12, 2015 at 1:35 PM, Ralf Quint wrote: Either the while loop is executed or it isn't, depending in the expression. I don't see an actual use case for any else/otherwise extension to it... You probably want to reread python w

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Max Nazhalov
>> I can't think of a use case either. And just because another language >> provides such a solution, does not imply that FPC should. As to achieving >> the functionality in FPC: >> >> if cond then >>while cond do >> foo >> else >>bar; > >That's what I've thought about from the beginni

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread DaWorm
I guess I'm confused. What is the difference between: while true do this then that and: while true do this that And what is better about: while true do this otherwise/else that and: if true while true do this else that The latter may have a difference if the thing that returns true for

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Ralf Quint
On 10/12/2015 11:33 AM, Sven Barth wrote: Am 12.10.2015 20:02 schrieb "Dmitry Boyarintsev" mailto:skalogryz.li...@gmail.com>>: > > On Mon, Oct 12, 2015 at 1:54 PM, Ralf Quint > wrote: >> >> Sorry, we are programming here in Pascal, not Python. I could give a rode

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Sven Barth
Am 12.10.2015 20:02 schrieb "Dmitry Boyarintsev" : > > On Mon, Oct 12, 2015 at 1:54 PM, Ralf Quint wrote: >> >> Sorry, we are programming here in Pascal, not Python. I could give a rodent's posterior about what Python implements. >> >> People need to properly design their software, not just hackin

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Marco van de Voort
In our previous episode, Sven Barth said: > world ( > http://docwiki.embarcadero.com/RADStudio/XE3/en/Declarations_and_Statements#Case_Statements) > ?! > > I can see that FPC compiles case-otherwise for any syntax mode. > > It's from Extended ISO Pascal and I don't know for how long it exists in >

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Steve Smith
On 12/10/15 18:47, Dmitry Boyarintsev wrote: On Mon, Oct 12, 2015 at 1:35 PM, Ralf Quint mailto:freedos...@gmail.com>> wrote: Either the while loop is executed or it isn't, depending in the expression. I don't see an actual use case for any else/otherwise extension to it... You p

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Mark Morgan Lloyd
Ralf Quint wrote: On 10/12/2015 10:18 AM, Michael Van Canneyt wrote: That is the meaning of "However, both syntax would cause code incompatibility." and is already in my very first reply to OP. So While... else or While .. Otherwise will never make it in the compiler. Thanks for that. Thi

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Dmitry Boyarintsev
On Mon, Oct 12, 2015 at 1:54 PM, Ralf Quint wrote: > Sorry, we are programming here in Pascal, not Python. I could give a > rodent's posterior about what Python implements. > > People need to properly design their software, not just hacking away. Then > they do not need to come up with whacko sto

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Ralf Quint
On 10/12/2015 10:47 AM, Dmitry Boyarintsev wrote: On Mon, Oct 12, 2015 at 1:35 PM, Ralf Quint > wrote: Either the while loop is executed or it isn't, depending in the expression. I don't see an actual use case for any else/otherwise extension to it...

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Dmitry Boyarintsev
On Mon, Oct 12, 2015 at 1:35 PM, Ralf Quint wrote: > > Either the while loop is executed or it isn't, depending in the > expression. I don't see an actual use case for any else/otherwise extension > to it... > You probably want to reread python while-else implementation. ( https://docs.python.or

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Ralf Quint
On 10/12/2015 10:18 AM, Michael Van Canneyt wrote: That is the meaning of "However, both syntax would cause code incompatibility." and is already in my very first reply to OP. So While... else or While .. Otherwise will never make it in the compiler. Thanks for that. This is s typical exam

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Michael Van Canneyt
On Mon, 12 Oct 2015, Max Nazhalov wrote: On 12.10.2015 17:17 schrieb "Dmitry Boyarintsev" wrote: About while-then. While the syntax is unlikely to break anything, it's inconsistent with if-statement. where, if-then is executed when condition is true. For while-then is executed then conditi

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Sven Barth
Am 12.10.2015 17:17 schrieb "Dmitry Boyarintsev" : > About while-then. While the syntax is unlikely to break anything, it's inconsistent with if-statement. > where, if-then is executed when condition is true. > For while-then is executed then condition is false. > Thus, while-else or while-otherwis

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-12 Thread Dmitry Boyarintsev
On Mon, Oct 12, 2015 at 2:07 AM, Sven Barth wrote: > It's from Extended ISO Pascal and I don't know for how long it exists in > FPC already, but it does so definitely for some time. > Thanks! I've never thought to go and read the FP documentation on "case statement", assuming it works in turbo pa

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Sven Barth
Am 12.10.2015 03:19 schrieb "Dmitry Boyarintsev" : > > a bit off-topic, > > But has case-otherwise been in FPC from the start? > > I believe it came from GNU pascal ( http://www.gnu-pascal.de/gpc/otherwise.html) and never existed in Delphi world ( http://docwiki.embarcadero.com/RADStudio/XE3/en/Dec

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Sven Barth
Am 11.10.2015 23:56 schrieb "Steve Smith" : > > Am I being stupid? It's late here so... > > What's wrong with > > === code begin === > > while bool do >foo; > bar; > > or > > repeat >foo; > until bool; > > bar; > > === code end === You know... You got me there... Though at least for th

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Dmitry Boyarintsev
a bit off-topic, But has case-otherwise been in FPC from the start? I believe it came from GNU pascal ( http://www.gnu-pascal.de/gpc/otherwise.html) and never existed in Delphi world ( http://docwiki.embarcadero.com/RADStudio/XE3/en/Declarations_and_Statements#Case_Statements) ?! I can see that F

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Martin Frb
On 11/10/2015 22:33, Tomas Hajny wrote: On Sun, October 11, 2015 22:48, Sven Barth wrote: . . That "then" is a great idea! That would definitely not break anything and it would make sense indeed: === code begin === while bool do foo then bar; repeat foo; until bool then bar; ==

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Steve Smith
On 11/10/15 22:52, Steve Smith wrote: On 11/10/15 21:48, Sven Barth wrote: That "then" is a great idea! That would definitely not break anything and it would make sense indeed: === code begin === while bool do foo then bar; repeat foo; until bool then bar; === code end === Rega

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Steve Smith
On 11/10/15 21:48, Sven Barth wrote: That "then" is a great idea! That would definitely not break anything and it would make sense indeed: === code begin === while bool do foo then bar; repeat foo; until bool then bar; === code end === Regards, Sven Am I being stupid? It's lat

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Tomas Hajny
On Sun, October 11, 2015 22:48, Sven Barth wrote: . . > That "then" is a great idea! That would definitely not break anything and > it would make sense indeed: > > === code begin === > while bool do > foo > then > bar; > > repeat > foo; > until bool then > bar; > === code end === I'm afr

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Sven Barth
Am 11.10.2015 18:34 schrieb "Martin Frb" : > > On 11/10/2015 16:14, Sven Barth wrote: >> >> Am 11.10.2015 15:56 schrieb "MohsenTi" : >> > >> > Hi everybody >> > >> > I add new feature to FPC compiler to simplify programming. >> > this is While - Otherwise working like While - Else in python and has

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Sven Barth
Am 11.10.2015 18:56 schrieb "MohsenTi" : > I checked failed ones but it seems they are not related to my changes. It's best you compare the faillist files in tests/output/cpu-os from an unmodified and a modified run. This way you can find out if you had any changes in the testsuite. Also the test

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread MohsenTi
I create 2 test files depends on testsuite readme file and make testsuite with make full command and set TEST_FPC variable to fpc ppcx64 compiler. for-otherwise and while-otherwise diff file and test files attached to email. test result : Total = 6906 (75:6831) Total number of compilations = 426

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Martin Frb
On 11/10/2015 16:14, Sven Barth wrote: Am 11.10.2015 15:56 schrieb "MohsenTi" >: > > Hi everybody > > I add new feature to FPC compiler to simplify programming. > this is While - Otherwise working like While - Else in python and has backwards compatibility. Nic

Re: [fpc-devel] Fwd: While - Otherwise Statement

2015-10-11 Thread Sven Barth
Am 11.10.2015 15:56 schrieb "MohsenTi" : > > Hi everybody > > I add new feature to FPC compiler to simplify programming. > this is While - Otherwise working like While - Else in python and has backwards compatibility. Nice idea with the otherwise. I first thought that this would break case-stateme