Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Henry Vermaak
On Wed, Jan 09, 2013 at 08:31:14PM +0100, Marco van de Voort wrote: > I guess that is the bright side of it all. Sooner or later we can have an > obfuscated Pascal contest, just like the other ones :-) I'm sure we can already have a contest just with the careful application of macros :) Henry ___

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > :-) I meant what I wrote: a comparison on the right producing a Boolean > which is assigned to three variables in a list. The parentheses were to > try to make it a bit clearer, and I note that a Perl list is in > parentheses rather than bracket

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Mark Morgan Lloyd
Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said: [a, b, c] := (d = e); would have been minimally acceptable. Did you really mean that or did you mean [a, b, c] := (d := e); ? :-) :-) I meant what I wrote: a comparison on the right producing a Boolean which i

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > [a, b, c] := (d = e); > > would have been minimally acceptable. Did you really mean that or did you mean [a, b, c] := (d := e); ? :-) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org htt

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Mark Morgan Lloyd
Henry Vermaak wrote: On Wed, Jan 09, 2013 at 10:46:54AM +, Mark Morgan Lloyd wrote: I've got a vague recollection that since that episode the kernel maintainers have mandated a use of parentheses that helps the compiler pick up the distinction between an equality and an Assignment inside i

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Henry Vermaak
On Wed, Jan 09, 2013 at 10:46:54AM +, Mark Morgan Lloyd wrote: > I've got a vague recollection that since that episode the kernel > maintainers have mandated a use of parentheses that helps the > compiler pick up the distinction between an equality and an Assignment inside if statements are us

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Mark Morgan Lloyd
Henry Vermaak wrote: On Wed, Jan 09, 2013 at 08:42:22AM +, Mark Morgan Lloyd wrote: But if you want an example of a very nasty bug caused by C/C++ multiple assignment, there was a well-documented attempt to slip a privilege escalation into the Linux kernel based on this a few years ago. It'

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Henry Vermaak
On Wed, Jan 09, 2013 at 08:42:22AM +, Mark Morgan Lloyd wrote: > But if you want an example of a very nasty bug caused by C/C++ > multiple assignment, there was a well-documented attempt to slip a > privilege escalation into the Linux kernel based on this a few years > ago. > > It's very easy

Re: [fpc-pascal] Changing variable in conditional

2013-01-09 Thread Mark Morgan Lloyd
Jorge Aldo G. de F. Junior wrote: Your phrase almost made me care about... Do you wanna make me care ? Show some points, make a constructive critic about what i said etc. For all that matter, your answer is just a plain old argumentum ad hominem, a fallacy category, and being a fallacy, tells m

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Jorge Aldo G. de F. Junior
Your phrase almost made me care about... Do you wanna make me care ? Show some points, make a constructive critic about what i said etc. For all that matter, your answer is just a plain old argumentum ad hominem, a fallacy category, and being a fallacy, tells me you cant really make a good answer

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Henry Vermaak
On Tue, Jan 08, 2013 at 08:19:15AM -0300, Jorge Aldo G. de F. Junior wrote: > C programmers are (usually, but there are a lot of exceptions) bad > programmers who confuse the power of a language with the capability of > decrease the ammount of typing needed to reach a certain goal. > > They despis

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Henry Vermaak
On Tue, Jan 08, 2013 at 09:58:19AM +0100, Krzysztof wrote: > I don't like a lot of C++ syntax but this one is interesting. You really > don't like it? :) Most C programmers I've dealt with (including myself) consider this bad practise. Henry ___ fpc-pas

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Mark Morgan Lloyd
Marco van de Voort wrote: In our previous episode, Krzysztof said: I don't like a lot of C++ syntax but this one is interesting. You really don't like it? :) It's the worst thing ever. 95% of the hard to find errors in C in my code are due to = vs == mixup. Seconded. In fact, if assignment d

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Jorge Aldo G. de F. Junior
C programmers are (usually, but there are a lot of exceptions) bad programmers who confuse the power of a language with the capability of decrease the ammount of typing needed to reach a certain goal. They despise pascal because pascal is somewhat verbose (ignoring that this is what makes pascal r

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Marco van de Voort
In our previous episode, Krzysztof said: > I don't like a lot of C++ syntax but this one is interesting. You really > don't like it? :) It's the worst thing ever. 95% of the hard to find errors in C in my code are due to = vs == mixup. ___ fpc-pascal mai

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Krzysztof
I don't like a lot of C++ syntax but this one is interesting. You really don't like it? :) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread ik
On Tue, Jan 8, 2013 at 10:44 AM, Krzysztof wrote: > Hi, > > I like when Free Pascal trying to implement best practices from other > languages. That was with increment variable using assign operator: i += 1. > Anyway, few days ago I analyzed C++ code and I liked one syntax: > > if ( ( i = GetSomeVa

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Mattias Gaertner
On Tue, 8 Jan 2013 09:44:13 +0100 Krzysztof wrote: > Hi, > > I like when Free Pascal trying to implement best practices from other > languages. That was with increment variable using assign operator: i += 1. > Anyway, few days ago I analyzed C++ code and I liked one syntax: > > if ( ( i = GetSo

Re: [fpc-pascal] Changing variable in conditional

2013-01-08 Thread Michael Fuchs
Am 08.01.2013 09:44, schrieb Krzysztof: I like when Free Pascal trying to implement best practices from other languages. That was with increment variable using assign operator: i += 1. Anyway, few days ago I analyzed C++ code and I liked one syntax: if ( ( i = GetSomeValue ) >= 10 ) { // vari