Tom Schneider wrote:
The first, or the most recent one, that's still a question. After some experimenting, there seem to be points for both ways. I'm implementing the latter now (though it should be easy to change). So, e.g.:
program Baz;
procedure Foo; var BaR: Integer; begin end;
begin WriteLn (bar) end.
will complain about an unknown identifier `bar', not `BaR' ...
I would strongly vote for using the first occurrence because that is the one which is the definition!
Not necessarily, as Markus has pointed out.
If one is disciplined, then all later cases should follow the definition!
In this case, it doesn't matter which occurrence we take since all will be the same. ;-)
Note: only Germans like to capitalize all nouns!
I know, and that's not the reason why this rule was introduced (long ago). Rather it was to avoid asmname conflicts with libc routines etc. -- see, e.g., Pierre's mail for detailed explanations.
Oh. I think that you should either:
- ignore the conflicts and let the user deal with them.
Warn the user that a conflict has occurred.
or
- protect the user from such conflicts so they never have to deal
with them.
I want to be able to write 'vanilla flavor' Pascal programs that will work on many compilers. I have great hope that GPC is the end-all solution, but even so it is nice to allow my programs to work on other compilers. So I do not want to be forced to change variable names because of conflicts specific to the internal workings of a particular compiler. For example, the fact that I cannot name a procedure 'main' on the Sun compiler is rather obnoxious - I was forced to rename all my 'main' procedures to 'themain', and even have a tool for modifying Pascal programs to make such variable-name switches:
Again, I'm not modifying asmnames now, so there won't be any new conflicts. Sometime in the future, the asmnames have to be changed because of qualified identifiers, overloading etc., but then they'll get even less "obvious" names and conflicts should get even rarer (it might not be possible to avoid conflicts entirely if you link, e.g., some C code with very strange function names, but practically this shouldn't be an issue).
Russell Whitaker wrote:
Note: only Germans like to capitalize all nouns!
I know, and that's not the reason why this rule was introduced (long ago). Rather it was to avoid asmname conflicts with libc routines etc. -- see, e.g., Pierre's mail for detailed explanations.
Irregardless of either Case Checking or Warning messages, I would like to see the compiler output identifiers exactly as they appear in the offending source line. As it is now the compiler outputs 'Gothere' when the source could have been either 'gotHere' or 'goThere'. (bad pun intended).
That's what I'm doing now (i.e., output the last occurrence).
Frank