On 5 Mar 2005 at 3:12, Frank Heckenbach wrote:
[...]
In particular, we can't keep the current handling of `Result' (like a predefined identifier) in order to be Delphi compatible.
True.
[...]
So AFAICS the right thing to do for a Delphi compatible `Result' is to actually make it a local variable declaration (as we do for explicit result variables). This should be rather easy and will naturally handle scopes correctly.
Agreed.
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.
The Chief wrote:
So what should we do?
Nothing.
But you understand this would mean leaving things are they are (or disabling `Result' completely), in both cases being incompatible to Delphi (before we even started to achieve Delphi compatibility WRT OOP). Is that really what you want?
No. Please see above. Thanks.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/