noch
2006-02-22 14:41:28 UTC
Hello.
I tried to compile with oo2c 2 and xds oberon-2 compiler following
source
(example of oop programming in oberon from
http://www.modulaware.com/mdltws.htm )
---
MODULE ooptest;
TYPE T = RECORD x, y: INTEGER END;
TYPE
T0 = RECORD (T) z: REAL END; (* extension of T *)
T1 = RECORD (T) w: LONGREAL END; (* extension of T *)
TYPE
action = PROCEDURE (a,b: INTEGER): INTEGER; (* a procedural type
*)
T2 = RECORD (T)
Add: action (* "Add" is a "method" of the T2 class *)
END;
VAR
object: T2; result: INTEGER;
BEGIN
object.x := 123; object.y := 456;
result := object.Add (object.x, object.y); (* method call *)
END ooptest.
---
It compiled without errors and warnings, but crashed on a line
result := object.Add (object.x, object.y);
Is it compilers fault or mine?
Thanks
Norayr
I tried to compile with oo2c 2 and xds oberon-2 compiler following
source
(example of oop programming in oberon from
http://www.modulaware.com/mdltws.htm )
---
MODULE ooptest;
TYPE T = RECORD x, y: INTEGER END;
TYPE
T0 = RECORD (T) z: REAL END; (* extension of T *)
T1 = RECORD (T) w: LONGREAL END; (* extension of T *)
TYPE
action = PROCEDURE (a,b: INTEGER): INTEGER; (* a procedural type
*)
T2 = RECORD (T)
Add: action (* "Add" is a "method" of the T2 class *)
END;
VAR
object: T2; result: INTEGER;
BEGIN
object.x := 123; object.y := 456;
result := object.Add (object.x, object.y); (* method call *)
END ooptest.
---
It compiled without errors and warnings, but crashed on a line
result := object.Add (object.x, object.y);
Is it compilers fault or mine?
Thanks
Norayr