Prof A Olowofoyeku (The African Chief) wrote:
On 5 Mar 2005 at 3:12, Frank Heckenbach wrote:
Therefore, I think we need a separate option for `Result' anyway (independent of whether we decide to add `--enable-predefined-identifier' for other reasons -- I currently don't see a need for it, since predefined identifiers can be overriden easily, without the problems we have with `Result', but I may be convinced otherwise).
I suggested `--enable-result', but as it may confuse someone not familiar with this problem, perhaps rather `--enable-implicit-result' (to be more explicit ;-).
That is fine. If it were my decision however, I would simply generate a warning whenever a global variable "Result" is defined. That should warn whoever is porting legacy code about potential problems, and once he/she has ensured that there are no problems, then he/she can disable the warnings.
Perhaps if everybody wanted to port their code to the Delphi dialect. But default warnings would also appear for people who have no intention doing so (including myself ;-), and who wouldn't agree to calling their code "legacy", BTW.
IMHO it would be better to convice Borland to add explicit result variables (probably very easy to do for them) and add a warning for all that legacy code that uses implicit `Result', so one can change it, and they can finally disable it sometime. :-)
Frank