Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-21 Thread Ricardo Aguiar
Greetings: Running the code below we can see that the Finally works correctly with the exit statement: Program Test; {$mode objfpc}{$H+} Procedure x(i :Integer); Begin Try Begin WriteLn('Running Try'); if (i=2) then exit; WriteLn('After if(i=2)'); End; Finally Wr

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-20 Thread Vinzent Hoefler
On Sunday 20 April 2008 19:21, Andreas Berger wrote: > About break. I would like to see an implementation of Break(x) where > x is the number of loops to break out of. > Correction: I would not like this, I would LOVE it. Oh, another Adaism trying to creep into Pascal...? :D But let me revisit y

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-20 Thread Zaher Dirkey
I am not like break(x) it also make improvement my procedure was sensitive, i must count how many loop i have in, and i must care if i added a new loop around the code that looped (hmm bad english). On Sun, Apr 20, 2008 at 7:21 PM, Andreas Berger <[EMAIL PROTECTED]> wrote: > > > > > > C provides

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-20 Thread Andreas Berger
C provides the infinitely-abusable goto statement, and labels to branch to. Formally the goto is never necessary and in practice it is almost always easy to write code without it. We have not used goto in this book. Nonetheless , we will suggest a few situations where goto's may find a pla

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-20 Thread Andreas Berger
mm wrote: Zaher Dirkey a écrit : I hate exit when i try to improve a procedure some code if (b) then exit; some code for long procedures i cant notice exit here and add some resource or memory uses AnObject := TAnObject.Create; try some code if (b) then exit; some code finally

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-20 Thread greim
Lets hear what the old fathers told us... when Linus Torvalds was still running around the Christmas tree Niklaus Wirth, Algorithms and Data Structures 1985 (Oberon version: August 2004, afaik first published 1975 in German) (Regarding pointers and goto statements..) ...This phenomenon

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-19 Thread mm
Zaher Dirkey a écrit : I hate exit when i try to improve a procedure some code if (b) then exit; some code for long procedures i cant notice exit here and add some resource or memory uses AnObject := TAnObject.Create; try some code if (b) then exit; some code finally AnObject.Fre

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-19 Thread Zaher Dirkey
I hate exit when i try to improve a procedure some code if (b) then exit; some code for long procedures i cant notice exit here and add some resource or memory uses AnObject := TAnObject.Create; try some code if (b) then exit; some code finally AnObject.Free; end; Now Exit leave t

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-18 Thread Ricardo Aguiar
Hi! GCC and almost all the other C implementations have the goto statement. It is just ugly and dangerous use it many times in a program. But IMHO any compiled language should have goto because many times we need to do unstructured code to run fast (in complex search code for example). So go

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-18 Thread mm
Vinzent Hoefler a écrit : On Thursday 17 April 2008 17:53, mm wrote: Rodrigo Palhano a écrit : On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of progra

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-18 Thread Andreas Berger
for a := 0 to x do for b := 0 to y do for c := 0 to z do if (...) then begin // Do something and then exit all loops exit; // Or maybe: goto OutSideOfLoops; end; In Pascal I can't change the 'a' and 'b' values to force the end of the loop. So what other GOOD

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Jonas Maebe
On 17 Apr 2008, at 21:25, Andreas Berger wrote: for a := 0 to x do for b := 0 to y do for c := 0 to z do if (...) then begin // Do something and then exit all loops exit; // Or maybe: goto OutSideOfLoops; end; In Pascal I can't change the 'a' and 'b' values t

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread wi
C does have goto. cheers Wayne On Thu, Apr 17, 2008 at 12:57 PM, Marco Alvarado <[EMAIL PROTECTED]> wrote: > The problem of GOTO is that C doesn't have one. If C had one, and > Pascal didn't have a GOTO, they would blame Pascal for not having it. > In assembler GOTOs make a lot of sense (i.e. J

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Marco Alvarado
The problem of GOTO is that C doesn't have one. If C had one, and Pascal didn't have a GOTO, they would blame Pascal for not having it. In assembler GOTOs make a lot of sense (i.e. JMP and Jxx), and it's weird C doesn't have one, after all C tries to be the lowest level of the highest level languag

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Andreas Berger
I think "exit" and "goto" have their uses. Here is an example: for a := 0 to x do for b := 0 to y do for c := 0 to z do if (...) then begin // Do something and then exit all loops exit; // Or maybe: goto OutSideOfLoops; end; In Pascal I can't change the

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Alan Krause
Rodrigo Palhano wrote: this if ( payments per year <> 12 ) then begin Result := 1; exit; end; if ( rate = 0 ) then begin Result := 2; exit; end; is better than this ? if ( payments per year <> 12 ) then begin Result := 1 Else if ( rate = 0 ) then Result := 2; or even this ? In my

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Rodrigo Palhano
this if ( payments per year <> 12 ) then begin Result := 1; exit; end; if ( rate = 0 ) then begin Result := 2; exit; end; is better than this ? if ( payments per year <> 12 ) then begin Result := 1 Else if ( rate = 0 ) then Result := 2; or even this ? begin If not CheckPayments (Re

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Rodrigo Palhano
if X = 0 then Exit; at the beginning of the procedure, one writes if X <> 0 then begin When you use it at the begining it may be arguably ok. But when it is used in the middle of procedure code it may be hard to notice. On Thu, 17 Apr 2008 13:07:45 -0300, ik <[EMAIL PROTECTED]> wro

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Vinzent Hoefler
On Thursday 17 April 2008 17:53, mm wrote: > Rodrigo Palhano a écrit : > > On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: > >> I use GO TO when teaching pascal, but after all i ask them to not > >> use it, it > >> just a bridge to learning the logic of programming lang

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Alan Krause
mm wrote: Using "Exit" is not of a bad programming practice. Suppose one has to write a big procedure, say 150 lines of code. Suppose now that, instead of writing if X = 0 then Exit; at the beginning of the procedure, one writes if X <> 0 then begin ... Does a reader immediately see

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread ik
On Thu, Apr 17, 2008 at 6:53 PM, mm <[EMAIL PROTECTED]> wrote: > Rodrigo Palhano a écrit : > > > > On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> > wrote: > > > > > > > I use GO TO when teaching pascal, but after all i ask them to not use > it, it > > > just a bridge to learni

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread mm
Rodrigo Palhano a écrit : On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of programming language. There is another word i hate to use it it is EXIT.

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Rodrigo Palhano
On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of programming language. There is another word i hate to use it it is EXIT. I also understand EXIT as

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Zaher Dirkey
I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of programming language. There is another word i hate to use it it is EXIT. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Rodrigo Palhano
The original text about this matter. Go To Statement Considered Harmful Edsger W. Dijkstra http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html On Tue, 15 Apr 2008 08:50:43 -0300, Florian Klaempfl <[EMAIL PROTECTED]> wrote: Vinzent Höfler schrieb: Marco

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Florian Klaempfl
Vinzent Höfler schrieb: Marco van de Voort wrote: Ahthe old goto arguinghow many beers have gone with it! Linus is just right, since everyday the purists of the OO languages still can't live without writing a GOTO; they just call it in another "politically correct" way: raise Exce

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Marco van de Voort
> Marco van de Voort wrote: > >> Ahthe old goto arguinghow many beers have gone with it! > >> Linus is just right, since everyday the purists of the OO languages > >> still can't live without writing a GOTO; they just call it in another > >> "politically correct" way: > >> > >> raise Ex

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Vinzent Höfler
Marco van de Voort wrote: Ahthe old goto arguinghow many beers have gone with it! Linus is just right, since everyday the purists of the OO languages still can't live without writing a GOTO; they just call it in another "politically correct" way: raise Exception.Create("TA-DA!")

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Joost van der Sluis
Op dinsdag 15-04-2008 om 10:21 uur [tijdzone +0200], schreef Marco van de Voort: > > Linus also put (traditional) before pascal, just to make this clear. > So > > I don't see this as a 'rant on pascal', but just arguing with some > > examples of older languages that goto's could be good in some ca

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Marco van de Voort
> Op dinsdag 15-04-2008 om 10:18 uur [tijdzone +0300], schreef ik: > > I have read in the Linux Kernel malling list some emails, and I found > > some points made by Linus Torvalds about Pasca; > > > > http://idkn.wordpress.com/2008/04/15/the-reason-why-linus-torvalds-hate-pascal/ > > > > Your st

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Marco van de Voort
> Ahthe old goto arguinghow many beers have gone with it! > Linus is just right, since everyday the purists of the OO languages > still can't live without writing a GOTO; they just call it in another > "politically correct" way: > > raise Exception.Create("TA-DA!") There is a fundamen

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Roberto Padovani
Ahthe old goto arguinghow many beers have gone with it! Linus is just right, since everyday the purists of the OO languages still can't live without writing a GOTO; they just call it in another "politically correct" way: raise Exception.Create("TA-DA!") R# 2008/4/15, Joost van der S

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Joost van der Sluis
Op dinsdag 15-04-2008 om 10:18 uur [tijdzone +0300], schreef ik: > Hi, > > I have read in the Linux Kernel malling list some emails, and I found > some points made by Linus Torvalds about Pasca; > > http://idkn.wordpress.com/2008/04/15/the-reason-why-linus-torvalds-hate-pascal/ > Your statement

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Florian Klaempfl
Who is Linus Torvalds? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal