On 25 May 2004 at 19:10, Frank Heckenbach wrote:
[...]
AFAIKS in OOE mode `object' is not (or should not be) a keyword, so part of the problem vanishes. Do we implement `class' already?
Not yet, but I don't see how it relates to the issue. The issue, a potential confusion between two syntactically identical things, is the same in BP and OOE object models, AFAICS, so I think it would only add to the confusion to treat it differently based on the object model.
Of course, an OOE test program will need to use `class' then, so I can't test such a program now, if you mean this.
If yes, then it is worth checking what Delphi is doing.
For now I'm treating Delphi like BP here (i.e., only a warning), but if it turns out it should be an error (Chief, did you check this already?), I can change it.
I checked it. It is exactly the same as BP, whether using "class" or "object". Below is an example using "class". It prints "99".
program delphi_oop; type o = class function f: Integer; end;
oo = class (o) o: record f: Integer end; procedure p; end;
function o.f: Integer; begin f := 42 end;
procedure oo.p; begin WriteLn (o.f) end;
var v: oo; begin v := oo.create; v.o.f := 99; v.p end.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/