El 11/10/2016 a las 10:03, Marco van de Voort escribió:
> In our previous episode, Santiago A. said:
>> I think that "automatic overriding" is a wrong design from the first
>> turbo pascal and should be fixed. The need of overriding system
>> functions like memory managers is a corner case to treat, not a reason
>> to not solve the unexpected hide of declarations.
> Well, the problem mainly exists because you don't have any control over
> importing symbols from an unit other than "all".
> A different route would to fix that (like Modula2 or "qualified" importing
> like in again M2 but also GPC).
My two cents:
Whenever there is a conflict, an ambiguity, you must full qualify the
identifier otherwise the compiler will complain.
For the special cases, when you need to hide the declaration, you could
use the directive "override" for global declarations (types, functions,
procedures, const, vars) , so the compiler knows that it must ignore
previous declaration if the identifier is not full qualified. Just like
it does now.
For compatibility issues, you could add a compiler check, i.e.
fpc-pascal maillist - email@example.com