On 17 Oct 2001, at 22:02, CBFalconer wrote:
I don't consider such hiding an error.
I believe that you miss my point, which is not that such hiding is erroneous, nor that such hiding is undesirable, but rather that when the programmer defines two variables that __differ only in case__ in Pascal, it is likely to be a programming mistake. This is especially true if the programmer has more familiarity with languages that are case-sensitive than with Pascal.
If the programmer does this:
var CoGentry : integer; [...] CogEntry : integer;
...the compiler will produce a diagnostic because of the duplicate variable definition. However, with:
var CoGentry : integer;
procedure p; var CogEntry : integer;
procedure q; begin [...] CoGentry := 1; [...] end;
...no diagnostic is produced (because the program is legal), but the main block variable "CoGentry" is *not* assigned the value 1 as the programmer clearly intended.
It is in this latter case that a warning would be appropriate.
-- Dave