Re: [fpc-pascal] Changing variable in conditional
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 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 brackets. > > I'm not saying I like it, or that it's Pascal. But something like that > would probably upset the fewest people that matter. Perhaps I should > have said > > [a, b, c] += Ord(d = e); > > :-) 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 :-) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 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 brackets. I'm not saying I like it, or that it's Pascal. But something like that would probably upset the fewest people that matter. Perhaps I should have said [a, b, c] += Ord(d = e); :-) -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 if statements are usually frowned upon in the kernel. gcc warns if you don't use parentheses, but I usually use parentheses for readability, so there's always a danger of making a typo and not getting a warning. Can't remember the last time I've had a bug of this sort, but that's probably because I'm extra vigilant with conditionals. I think the decision to keep this syntax out of pascal is a good one. I use C barely at all. In the words of one of the M2 vendors "We come to bury C, sir, not to praise it". If Pascal /had/ to have some sort of multiple assignment, I'd have thought borrowing an idea from Perl and doing something like [a, b, c] := (d = e); would have been minimally acceptable. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: FPC's broken cross-compiler directory structure?
> Thanks, but that's what the make file appears to do already (crossinstall into a local target which is then zipped). Owh, then it should be correct. My automatic build script installs to correct directory structure for winXX targets... something must be wrong there... -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FPC-s-broken-cross-compiler-directory-structure-tp5712491p5712527.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Use of abstract classes
09.01.13, 20:57, Michael Fuchs wrote: Am 08.01.2013 23:43, schrieb Paul Ishenin: What is the best way for a discussion on this? Should I create a feature request in bugtracker? First create a desired implementation with a patch. I would do it, if I only know where to start. Unfortunately are my experiences in compiler programming equal to zero. Is there a document how to start? Maybe a architecture diagram? I started from compiler sources. You need mostly parser part - that units start from 'p'. For example object types (objects, classes, interfaces, ... too) parsing is located in pdecobj.pas. Abstract modifier parsing is located in parse_object_options method - see for include(.., oo_is_abstract). Then you need something similar like a warning which is raised when a class with abstract members is created. Search where this warning is raised. Add something similar but with check for abstract class there. But only not for delphi modes. BTW: How long does it normally take, until a patch is integrated (or declined)? Two month ago I submitted a patch for a bug in SQLite3db. Is it better to wait or to inquire? Sorry for the dumb questions, this is new territory for me. If patch from a bug tracker is not noticed just write a mail. Most of developers read their mails although not everybody check the bug tracker every day. You will get valuable experience in any case even if your patch is rejected ;) Best regards, Paul Ishenin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 usually frowned upon in the kernel. gcc warns if you don't use parentheses, but I usually use parentheses for readability, so there's always a danger of making a typo and not getting a warning. Can't remember the last time I've had a bug of this sort, but that's probably because I'm extra vigilant with conditionals. I think the decision to keep this syntax out of pascal is a good one. Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Use of abstract classes
Am 08.01.2013 23:43, schrieb Paul Ishenin: What is the best way for a discussion on this? Should I create a feature request in bugtracker? First create a desired implementation with a patch. I would do it, if I only know where to start. Unfortunately are my experiences in compiler programming equal to zero. Is there a document how to start? Maybe a architecture diagram? BTW: How long does it normally take, until a patch is integrated (or declined)? Two month ago I submitted a patch for a bug in SQLite3db. Is it better to wait or to inquire? Sorry for the dumb questions, this is new territory for me. Michael [1] - http://bugs.freepascal.org/view.php?id=23247 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Use of abstract classes
On Tue, January 8, 2013 23:43, Paul Ishenin wrote: > 09.01.13, 6:26, Michael Fuchs пишет: > >> What is the best way for a discussion on this? Should I create a feature >> request in bugtracker? > > First create a desired implementation with a patch. Well, I may overlook something, of course, but I believe that this request probably shouldn't fall into the category of things which are difficult/time-demanding for the compiler people (if it should be implemented, of course, but I haven't seen any arguments against it raised yet). If you believe that it may be difficult, please clarify it. I understand that the requested behaviour needs to be described well, of course, but if my understanding is correct, requiring the original poster to implement it himself may not be appropriate in this case (not very efficient - a lot of learning effort necessary for the original poster compared to hopefully limited effort for existing core team members). It is important to notify the poster that filing the feature request doesn't guarantee that it gets implemented (soon or ever). Nevertheless, _requiring_ all suggestions to be accompanied with a patch is IMHO too much. Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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's very easy to argue against multiple assignment. It's less easy to argue against implementing an equivalent of the C/C++ conditional. Are you talking about this one? http://lwn.net/Articles/57135/ Yes, although it took me a few minutes Googling after I posted the earlier comment before I had the reference to hand. 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. But it's unfortunate when programmers have to use a contrived form to work around sloppiness in the language design... I'm specifically talking about ill-conceived syntax here, not about flexibility that you get from easy access to things like pointer arithmetic. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 to argue against multiple assignment. It's less easy > to argue against implementing an equivalent of the C/C++ > conditional. Are you talking about this one? http://lwn.net/Articles/57135/ Henry ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Changing variable in conditional
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 me you cant really make a good answer, so i infer you are the idiot here. Please- that really wasn't called for. It's quite obvious from context that Henry was simply agreeing with your Pascal generally improves programmer productivity. Lets not break this by adding crazy ideas from C/C++ family of languages... "Better to keep your mouth closed and be thought a fool than to open it and remove all doubt" 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 to argue against multiple assignment. It's less easy to argue against implementing an equivalent of the C/C++ conditional. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] [admin] Changing variable in conditional
On 09 Jan 2013, at 04:00, Jorge Aldo G. de F. Junior wrote: Your phrase almost made me care about... And that's enough for this little language war, thank you. Feature requests like this can certainly be discussed, but please do so without starting to insult programmers using other languages or each other. Thanks, Jonas FPC mailing lists admin___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal