mkhaldi@softaddicts.ca wrote:
I'd like to debug a pascal program. When I run it in gdb, I can't examine the variables. I can examine my variables before running it in gdb.
I put yet the compile options to have debug information. So, what do I do to get the variables' value when I run my program in gdb... Is it clear?
No. Did you actually read my previous mail? I wrote:
: PLEASE, try : to give some information with your requests! Like, the Pascal : source, and what you expected to get etc. ...
I suggest you read
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
and
http://www.catb.org/~esr/faqs/smart-questions.html
very thoroughly.
Before sending a request, read it again and imagine you're someone who doesn't know about your problem and see if you can make sense of your mail.
Sorry, but if you can't take the time to write a proper request, don't expect anyone to take the time to help you. I'll ignore such requests in the future.
And again, reply to the list, not personally.
Frank
A lovely feature I added to my own language when I wrote one about a dozen years ago was the construct "not in", eg:
if Ch not in ['A'..'Z'] then ...
I always thought this was much nicer than the ugly:
if not (Ch in ['A'..'Z']) then
as well as much clearer.
I don't know if others agree, but if so it might be a nice extension for GPC.
Anyway, just thought I'd mention it since I happened to be working on the docs for "in" ;-)
Enjoy, Peter.
Peter N Lewis wrote:
A lovely feature I added to my own language when I wrote one about a dozen years ago was the construct "not in", eg:
if Ch not in ['A'..'Z'] then ...
I always thought this was much nicer than the ugly:
if not (Ch in ['A'..'Z']) then
as well as much clearer.
I don't know if others agree, but if so it might be a nice extension for GPC.
Anyway, just thought I'd mention it since I happened to be working on the docs for "in" ;-)
It may be pretty to you, but think about the penalties. Even if the parsing could be contorted to fit, any code written with it is immediately incompatible with everything else. Pascal is a portable language. The original syntax was carefully designed for one char and one symbol lookahead. How do you then handle:
if not ch = 'A'; (* illegal *) or if not boolvar <> true; (* legal *)
Peter N Lewis wrote:
A lovely feature I added to my own language when I wrote one about a dozen years ago was the construct "not in", eg:
if Ch not in ['A'..'Z'] then ...
I always thought this was much nicer than the ugly:
if not (Ch in ['A'..'Z']) then
as well as much clearer.
It may be pretty to you, but think about the penalties. Even if the parsing could be contorted to fit, any code written with it is immediately incompatible with everything else. Pascal is a portable language. The original syntax was carefully designed for one char and one symbol lookahead. How do you then handle:
if not ch = 'A'; (* illegal *) or if not boolvar <> true; (* legal *)
I'm afraid I don't understand your comments at all, it doesn't seem that you actually read what I wrote, perhaps you read something you thought I wrote? I never discussed any change to the "not" unary operator, only adding a new binary operator made up of the two tokens "not" and "in". Parsing is easy, "not" cannot normally be used in places where a binary operator can be used, and then must be followed by "in".
I was not suggesting the ability to do not ch = 'A' (which would not make sense since you cannot negate a character). Only a companion binary operator for the "in" operator to be equivalent but negated.
That is "not in" is to "in" as "<>" is to "=".
So it is easy to parse with one char, one token look ahead, and has nothing to do with your two examples.
Yes, anything written to use it would not work on any other Pascal compiler. What's new? Anything written in GPC using the various extensions already present will not work on any other compiler either, unless you carefully choose which extensions you do and don't use, in which case, just turn on the relevant "standard" switch and you wont have any problems regardless.
Anything written in GPC is automatically portable - to all the systems that GPC works on.
Enjoy, Peter.
Peter N Lewis wrote:
I was not suggesting the ability to do not ch = 'A' (which would not make sense since you cannot negate a character).
In BP you can negate an integer which makes `not a = b' and `not a in c' (for a, b integers) valid and quite "unintuitive".
But that's unrelated to the actual point. ;-)
Frank
In article 200303150520.GAA04857@goedel.fjf.gnu.de, Frank Heckenbach frank@g-n-u.de writes
In BP you can negate an integer which makes `not a = b' and `not a in c' (for a, b integers) valid and quite "unintuitive".
Quite agree, confused the hell out of me the first time I came across it.
CBFalconer wrote:
Peter N Lewis wrote:
A lovely feature I added to my own language when I wrote one about a dozen years ago was the construct "not in", eg:
if Ch not in ['A'..'Z'] then ...
I always thought this was much nicer than the ugly:
if not (Ch in ['A'..'Z']) then
as well as much clearer.
I don't know if others agree, but if so it might be a nice extension for GPC.
Anyway, just thought I'd mention it since I happened to be working on the docs for "in" ;-)
It may be pretty to you, but think about the penalties. Even if the parsing could be contorted to fit, any code written with it is immediately incompatible with everything else. Pascal is a portable language. The original syntax was carefully designed for one char and one symbol lookahead. How do you then handle:
if not ch = 'A'; (* illegal *) or if not boolvar <> true; (* legal *)
Well, that's not quite the same. In the latter case, you'd just omit a pair of parentheses, while Peter suggested to put the `not' beside the `in'.
Indeed, this doesn't seem to cause a parsing conflict (I suppose that's because both `not' and `in' are ISO 7185 keywords, therefore unique in their contexts). It's comparable to GPC's `and then' and `or else' (where EP adds new keywords `and_then' and `or_else', unnecessarily IMHO). So it seems to be easy to implement.
But I agree with the problems concerning portability, and we should consider if it's worth the trouble. I've run into such cases a few times in my own code and thought about such a thing, but not so often that I felt I really needed it. Of course, YMMV if you use sets very much ...
So I guess I'm neutral here ...
Frank
I've wished for this, too, for some time now. Even tried to use it once or twice, forgetting that it was not Pascal until the code failed to compile!
if Ch not in ['A'..'Z'] then ...
I always thought this was much nicer than the ugly:
if not (Ch in ['A'..'Z']) then
as well as much clearer.
I don't know if others agree, but if so it might be a nice extension for GPC.
===== ======= Frank D. Engel, Jr.
Modify the equilibrium of the vertically-oriented particle decelerator to result in the reestablishment of its resistance to counterproductive atmospheric penetration.
__________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com