Forum > General
Keywords in Pascal
Zoran:
I would like to discuss something with the community.
* See the reserved words list in "User’s Guide"
The list contains: break, continue, exit, false, true
As discussed in the forum recently, these are not reserved words, as they can be redefined.
* See the Reserved Words chapter in "Reference Guide".
There they are divided to:
* TP reserved words
* Reserved words added in Object Pascal
* The list of "modifiers", which are described something like non-reserved keywords -- "break", "continue" and "exit" are listed there, but not "false" and "true".Before making a documentation bug report about "User's Guide" listing, I thought it might be worth to talk about it with the community.
I thought it might be better to keep the whole list there, but renaming it to "keywords", and then divide the list in two sections -- reserved and non-reserved.
So, what do you think, should "User's Guide" distinguish keywords from reserved words? Should "Reference Guide" include "false" and "true" in "modifiers"?
440bx:
--- Quote from: Zoran on October 27, 2024, 05:17:34 pm ---So, what do you think, should "User's Guide" distinguish keywords from reserved words? Should "Reference Guide" include "false" and "true" in "modifiers"?
--- End quote ---
I think the "User's guide" and the "Reference guide" should make it very clear that there are language "words" that, while not reserved words, should be considered as if they were because redefining them can cause all kinds of problems.
Essentially, I am in favor of making a list of "keywords" that have the characteristic mentioned above.
MarkMLl:
--- Quote from: 440bx on October 27, 2024, 06:29:00 pm ---I think the "User's guide" and the "Reference guide" should make it very clear that there are language "words" that, while not reserved words, should be considered as if they were because redefining them can cause all kinds of problems.
Essentially, I am in favor of making a list of "keywords" that have the characteristic mentioned above.
--- End quote ---
I'm inclined to agree, but I think the correct term is "reserved words": "keywords" sounds more like BASIC.
At that point the important question is whether reserved words could be tabulated against compiler modes, which hopefully would cover cases where in one mode it could be redefined while in other modes it could not.
And regrettably, we have to consider the variant terminology implicit in full ISO compatibility...
MarkMLl
Zoran:
--- Quote from: MarkMLl on October 27, 2024, 06:47:25 pm ---...
I'm inclined to agree, but I think the correct term is "reserved words": "keywords" sounds more like BASIC.
...
--- End quote ---
What do you mean? The whole point is that there are words which are special in Pascal, but not all of them are "reserved" (some can be redefined, eg. Break, Continue, Exit, False, True).
They cannot be named reserved words, this term remains reserved for the subset of these words which cannot be redefined.
TRon:
--- Quote from: Zoran on October 27, 2024, 05:17:34 pm ---So, what do you think, should "User's Guide" distinguish keywords from reserved words? Should "Reference Guide" include "false" and "true" in "modifiers"?
--- End quote ---
imho there should at least be a clear mention that they exist and distinguish them from "normal" reserved words (no matter how they are named/called).
Currently it is more a hit or miss when you are not familiar and can indeed cause all sort of issues (which imo should also be mentioned clearly).
Thank you for giving this attention.
Navigation
[0] Message Index
[#] Next page